A Python CLI tool that automatically organizes messy folders by sorting files into categorized subfolders based on their extension.
Before:
Downloads/
├── photo.jpg
├── resume.pdf
├── song.mp3
├── movie.mp4
├── data.json
├── app.dmg
After:
Downloads/
├── Img/ (jpg, jpeg, png, webp)
├── Doc/ (pdf, docx, xlsx, txt, mermaid)
├── Vid/ (mov, mp4)
├── Zip/ (zip, dmg)
├── JSON/ (json)
- Clone the repo:
git clone https://github.com/Pinkisingh13/file-organizer.git
cd file-organizer- Install dependencies (requires uv):
uv sync- Edit the path in
main.pyto your target folder:
organizeme("/path/to/your/messy/folder")- Run:
uv run main.py- Sorts files into categorized folders by extension
- Skips directories (only moves files)
- Skips files that already exist in the destination
- Prints a summary of moved and skipped files
| Folder | Extensions |
|---|---|
| Img | .jpg, .jpeg, .png, .webp |
| Doc | .pdf, .docx, .xlsx, .txt, .mermaid |
| Vid | .mov, .mp4 |
| Zip | .zip, .dmg |
| JSON | .json |
- Python 3.12
pathlibfor path handlingshutilfor moving files
MIT