An intelligent, automated file organization tool that monitors folders and sorts files by type with advanced features like duplicate detection, undo functionality, and statistics tracking. Built with Python and available as a standalone executable.
- 📁 Automatic File Monitoring: Real-time monitoring of folders with instant file organization
- 🎯 Smart Categorization: Automatically sorts files into categories (Images, Documents, Videos, Audio, etc.)
- 🔄 Manual Organization: Organize existing files with a single click
- 💾 Persistent Configuration: Saves your preferences and folder settings
- 🖥️ System Tray Integration: Minimize to system tray and manage from there
- 🔍 Duplicate Detection: Identifies duplicate files using MD5 hashing and moves them to a separate folder
- ⏮️ Undo Functionality: Reverse any file move operation with full history tracking (up to 100 operations)
- 📊 Statistics Dashboard: View detailed analytics about organized files
- 🎨 User-Friendly GUI: Clean, intuitive interface built with tkinter
- ⚙️ Customizable Categories: Easily modify file type categories and extensions
- 🚫 Single Instance Protection: Prevents multiple instances from running simultaneously
- Download the installer from the releases page
- Run the installer and follow the prompts
- Launch "Smart File Sorter" from your Start Menu
-
Install Python 3.7 or higher from python.org
-
Install Dependencies
pip install -r requirements.txt
-
Run the Application
python Smart_File_Sorter.py
-
Launch the Application
- If installed: Click "Smart File Sorter" in Start Menu
- If running from source:
python Smart_File_Sorter.py
-
Select a Folder
- Click the "Browse" button
- Choose the folder you want to monitor
- The folder path will be saved for future sessions
-
Start Monitoring
- Click "Start Monitoring" to begin automatic file organization
- Any new files added to the folder will be automatically sorted
- Click "Stop Monitoring" to pause monitoring
- Minimize to system tray to keep it running in the background
-
Organize Existing Files
- Click "Organize Now" to sort all files currently in the folder
- Useful for cleaning up existing clutter
- Click "Undo Last" to reverse the most recent file move
- Up to 100 operations are tracked in history
- History persists between sessions
- Full path recovery maintained
- Click "View Stats" to see:
- Number of files organized by category
- Total files processed
- Category distribution chart
- Enabled by default
- Automatic MD5 hash comparison
- Duplicate files moved to "Duplicates" folder
- Prevents duplicate organization
- Minimize to system tray
- Quick access menu:
- Show Window
- Start/Stop Monitoring
- Exit Application
The application organizes files into these default categories:
| Category | File Extensions |
|---|---|
| Images | .jpg, .jpeg, .png, .gif, .bmp, .svg, .webp, .ico, .tiff |
| Documents | .pdf, .doc, .docx, .txt, .rtf, .odt, .xls, .xlsx, .ppt, .pptx |
| Videos | .mp4, .avi, .mkv, .mov, .wmv, .flv, .webm, .m4v |
| Audio | .mp3, .wav, .flac, .aac, .ogg, .wma, .m4a |
| Archives | .zip, .rar, .7z, .tar, .gz, .bz2, .xz |
| Code | .py, .js, .html, .css, .java, .cpp, .c, .h, .json, .xml, .sql |
| Executables | .exe, .msi, .app, .dmg, .deb, .rpm |
| Others | All other file types |
| Duplicates | Auto-generated for duplicate files |
Edit the config.json file (created after first run) in your AppData folder:
{
"categories": {
"Images": [".jpg", ".jpeg", ".png"],
"MyCustomCategory": [".xyz", ".abc"],
"Documents": [".pdf", ".doc", ".docx", ".txt"]
},
"watched_folder": "C:\\Users\\YourName\\Downloads",
"enable_duplicates": true,
"enable_undo": true
}Smart_File_Sorter/
│
├── Smart_File_Sorter.py # Main application (source code)
├── SmartFileSorter.spec # PyInstaller configuration
├── requirements.txt # Python dependencies
├── build_installer.bat # Batch script to build installer
├── installer_script.iss # Inno Setup installer script
│
├── README.md # README
├── LICENSE # MIT License
├── config.json # Auto-generated (user config)
├── history.json # Auto-generated (undo history)
│
├── build/ # PyInstaller build output
│ └── SmartFileSorter/
│ ├── SmartFileSorter.exe
│ ├── Various .toc and .pyz files
│ └── localpycs/
│
└── installer_output/ # Inno Setup installer output
└── SmartFileSorterSetup.exe
Prerequisites:
- Python 3.7+
- All dependencies from
requirements.txt
Build Steps:
-
Install PyInstaller (included in requirements.txt)
pip install -r requirements.txt
-
Build the executable
pyinstaller SmartFileSorter.spec
Or manually:
pyinstaller --onefile --windowed --icon=app_icon.ico Smart_File_Sorter.py
-
Output
- Executable:
build/SmartFileSorter/SmartFileSorter.exe - Distributable: Place the entire
SmartFileSorter/folder
- Executable:
Prerequisites:
- Inno Setup 6.0+ (free download from innosetup.com)
- PyInstaller executable already built
Build Steps:
-
Using the batch script
build_installer.bat
-
Or manually with Inno Setup
- Open
installer_script.issin Inno Setup - Click "Build" → "Compile"
- Output:
installer_output/SmartFileSorterSetup.exe
- Open
-
Installer Features
- Automatic .exe installation
- Start Menu shortcuts
- Add/Remove Programs entry
- Optional desktop shortcut
- Uninstall capability
The application is built with a modular, object-oriented design:
-
Config Class: Manages configuration and persistence
- Loads/saves settings to JSON
- Manages category definitions
- Tracks folder preferences
-
FileOrganizer Class: Core sorting logic
- File categorization based on extensions
- Duplicate detection using MD5 hashing
- Operation history tracking
- Statistics collection
-
FileWatcher Class: Real-time file system monitoring
- Inherits from
watchdog.FileSystemEventHandler - Monitors file creation events
- Prevents duplicate processing
- Adds processing delay for file stability
- Inherits from
-
SmartFileSorterGUI Class: User interface
- Built with tkinter framework
- Folder selection dialog
- Real-time activity logging
- Statistics window
- System tray integration
- watchdog (3.0.0): File system event monitoring
- tkinter: Cross-platform GUI framework (bundled with Python)
- pystray (0.19.5): System tray functionality
- Pillow (10.1.0): Image handling for icons
- psutil (5.9.6): Process monitoring and management
- pyinstaller (6.1.0): Executable building (development only)
User Input
↓
File Created/Added
↓
FileWatcher detects event
↓
Get file extension
↓
Determine category
↓
Check for duplicates (MD5 hash)
↓
Create category folder if needed
↓
Handle filename conflicts
↓
Move file
↓
Record in history
↓
Update statistics
↓
Log activity
This project demonstrates advanced software engineering practices:
- ✅ Clean Code Architecture: Modular, object-oriented design with single responsibility principle
- ✅ GUI Development: Professional interface with tkinter, threading, and system integration
- ✅ File System Operations: Safe, robust file handling with error recovery
- ✅ Data Persistence: JSON-based configuration and comprehensive history tracking
- ✅ Error Handling: Comprehensive exception handling with user-friendly messages
- ✅ User Experience: Intuitive interface with real-time feedback and activity logging
- ✅ Advanced Features: Duplicate detection, undo functionality, statistics tracking
- ✅ Background Operations: Threading and system tray integration
- ✅ Deployment: PyInstaller and Inno Setup configuration for distribution
- ✅ Code Quality: Well-documented, commented code with clear function signatures
Location: C:\Users\YourName\AppData\Roaming\SmartFileSorter\config.json
{
"categories": {
"Images": [".jpg", ".jpeg", ".png", ".gif", ".bmp"],
"Documents": [".pdf", ".doc", ".docx", ".txt"],
"Videos": [".mp4", ".avi", ".mkv"],
"Audio": [".mp3", ".wav", ".flac"],
"Archives": [".zip", ".rar", ".7z"],
"Code": [".py", ".js", ".html", ".css"],
"Executables": [".exe", ".msi"],
"Others": []
},
"watched_folder": "C:\\Users\\YourName\\Downloads",
"enable_duplicates": true,
"enable_undo": true
}Tracks up to 100 file move operations for undo functionality.
| Issue | Solution |
|---|---|
| Application won't start | Ensure Python 3.7+ is installed; reinstall dependencies: pip install -r requirements.txt --upgrade |
| Files not organizing automatically | Check that "Start Monitoring" is active; verify folder path is valid and accessible |
| Permission errors | Run as Administrator; ensure you have write permissions to the target folder |
| Undo not working | Check that "enable_undo" is true in config.json; history file may be corrupted |
| Duplicate detection not working | Verify "enable_duplicates" is true in config.json |
| Multiple instances running | Check system tray; use Task Manager to close all instances; delete lock file in AppData |
| Installer won't run | Ensure Inno Setup 6.0+ is installed; check build_installer.bat script |
Run from command prompt to see error messages:
python Smart_File_Sorter.pyCheck logs in activity window for detailed operation information.
Potential features for version 2.0:
- 🌐 Cloud storage integration (Google Drive, OneDrive, Dropbox)
- 🤖 Machine learning-based file classification
- 📅 Date-based organization options (by year, month)
- 🔔 Desktop notifications for organized files
- 📝 Custom file naming rules with regex support
- 🌍 Multi-language support (internationalization)
- 🎨 Dark mode and customizable themes
- 📦 Auto-update functionality
- 🔐 Backup and restore settings
- 📱 Mobile companion app
This project is licensed under the MIT License - see the LICENSE file for details.
- ✅ Commercial use
- ✅ Modification
- ✅ Distribution
- ✅ Private use
- ❌ Liability
- ❌ Warranty
Anurag Wanwe
- GitHub: @Deathblu
- LinkedIn: Anurag Wanwe
- Email: anuwanwe1463@gmail.com
Contributions, issues, and feature requests are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
If this project helped you, please consider:
- ⭐ Giving it a star on GitHub
- 📣 Sharing it with others
- 💬 Providing feedback
For questions, feedback, or support:
- Email: anuwanwe1463@gmail.com
- GitHub Issues: Report bugs and request features
- GitHub Discussions: General questions and discussions
Note: This is a professional portfolio project designed to showcase Python development skills, GUI design, file system operations, and software engineering best practices. It is production-ready and fully functional.
Last Updated: February 6, 2026 Version: 1.0