A Python-based utility script that automatically scans, categorizes, and organizes media files and documents into dedicated folders using smart file extension detection and safe-moving logic. Built for cross-platform compatibility across Windows, macOS, and Linux.
-
Recursive Scanning: Deep scans the target directory, including all nested subfolders.
-
Smart Categorization: Automatically sorts files based on extension:
-
Photos:
.jpg,.png,.heic,.gif,.svg, etc.$\rightarrow$ Photos/ -
Videos:
.mp4,.mov,.mkv,.avi, etc.$\rightarrow$ Videos/ -
Others: Documents, archives, audio, and uncategorized files
$\rightarrow$ Others/ -
Safe-Moving Logic: Prevents accidental overwrites by automatically renaming duplicate file names during transfers.
-
Summary Report: Displays a final summary report detailing the total number of organized files.
-
Cross-Platform: Works natively on Windows, macOS, and Linux.
- Language: Python 3.x
- Standard Modules:
os,shutil,pathlib
Python 3.6 or higher must be installed on your system. No external package dependencies are required.
git clone https://github.com/your-username/auto-media-organizer.git
cd auto-media-organizer
python main.py
- Path Entry: Enter the absolute or relative target directory path when prompted.
- Recursive Scan: The script recursively traverses through all files and subdirectories.
- Extension Check & Sorting: Files are categorized based on their extension and moved to
Photos/,Videos/, orOthers/. - Collision Handling: If a file with the same name exists at the destination, safe auto-renaming resolves the conflict.
- Completion Summary: The terminal prints a final breakdown of files moved per category.