A lightweight Python script that automatically organizes files in a folder by their extensions.
It scans a given directory, then moves files into categorized subfolders (e.g., .jpg β Images, .pdf β Documents).
If duplicate filenames exist, it auto-renames them to avoid overwriting.
-
π Organizes files into categories:
- Images (
.jpg, .png, .gif, .svg, ...) - Videos (
.mp4, .mkv, .mov, ...) - Audio (
.mp3, .wav, ...) - Documents (
.pdf, .docx, .txt, ...) - Code (
.py, .js, .html, ...) - Archives (
.zip, .rar, .7z, ...) - Installers (
.exe, .msi, .apk, ...) - Others (unknown extensions)
- Images (
-
π Creates missing folders automatically.
-
π Handles file name conflicts (
file.txt β file (1).txt). -
π Skips locked files gracefully.
-
π¦ Works across platforms (Windows, Linux, macOS).
- Clone this repo:
git clone https://github.com/yourusername/file-organizer.git cd file-organizer