A simple Python script that organizes messy folders by sorting files into subfolders based on their file type. It supports 8 categories like Images, Documents, Videos, Audio, Code, etc. Also has an undo feature to reverse the organization if needed.
You only need Python 3 to run this script. No extra libraries needed — it uses only built-in modules (os, shutil, json).
You can visit here to download Python.
Organize files in the current directory:
python file_organizer.pyOrganize a specific folder:
python file_organizer.py /path/to/folderUndo the last organization:
python file_organizer.py --undoBefore:
Downloads/
├── report.pdf
├── photo.jpg
├── song.mp3
├── script.py
├── movie.mp4
└── data.csv
After running the script:
Downloads/
├── Documents/
│ ├── report.pdf
│ └── data.csv
├── Images/
│ └── photo.jpg
├── Audio/
│ └── song.mp3
├── Code/
│ └── script.py
└── Videos/
└── movie.mp4