A command-line utility that takes a messy folder and sorts everything inside it into clean, labeled categories — automatically.
I kept running into the same problem: a Downloads folder full of hundreds of random files with no structure. PDFs mixed with memes, ZIP archives sitting next to Python scripts. Searching for anything was a nightmare.
I wanted a tool I could actually use — not just mv commands buried in a shell script, but something with a proper menu, a preview mode so you don't accidentally move the wrong files, and duplicate handling so nothing gets silently overwritten.
This project was also a good excuse to work with pathlib and shutil properly instead of relying on os.path for everything.
- Scans a folder (including subfolders) for all files
- Sorts them into categories: Images, Documents, Code, Archives, Audio, Video, Other
- Supports preview mode — see what would happen before anything moves
- Supports move or copy mode
- Optionally cleans up filenames (spaces → underscores)
- Handles duplicates automatically (
file.jpg→file_1.jpg) - Skips hidden and system files
- Prints a summary when done
file_organizer/
├── main.py # Menu and user interaction
├── organizer.py # Core scan + organize logic
├── categorizer.py # File extension → category mapping
├── utils.py # Path validation, renaming, duplicate handling
├── config.py # Category definitions and settings
└── README.md
Requirements: Python 3.10 or higher (uses pathlib and type hints)
- Clone or download the project folder
- Open a terminal inside the
file_organizer/directory - Run:
python main.py- Follow the menu:
- Set your source folder (the messy one)
- Set your destination folder (where
Organized_Files/will be created) - Run a preview first to see what will happen
- Then organize
Organized_Files/
├── Images/
├── Documents/
├── Code/
├── Archives/
├── Audio/
├── Video/
└── Other/
- Python 3.10+
pathlib— modern path handlingshutil— file move and copy operationsre— filename cleanup- No external dependencies
- The tool won't touch the original files in preview mode
- If you use move mode, files are removed from the source after moving
- Hidden files (dotfiles,
__MACOSX, etc.) are automatically ignored - If a file with the same name already exists at the destination, it gets renamed with a counter suffix instead of being overwritten
GitHub: https://github.com/neyzik232