A professional, feature-rich file organization tool that automatically sorts files into categorized folders. Supports multiple organization methods, duplicate detection, undo functionality, and detailed logging.
- Multiple Organization Methods - Category, Date, Size, First Letter, or Smart combination
- Recursive Scanning - Organize files in subdirectories
- Dry Run Mode - Preview changes before executing
- Undo Functionality - Revert last organization operation
- Duplicate Detection - SHA256 hash-based duplicate finding
- Detailed Statistics - Track files moved, folders created, size processed
- Comprehensive Logging - Save detailed operation logs
- History Tracking - JSON-based operation history
- Color-coded Output - Easy-to-read console output
- Professional Error Handling - Graceful error recovery
- Python 3.7 or higher
- No external libraries required (uses only built-in modules)
-
Clone the repository: git clone https://github.com/poisonmunna/fileorganizer.git
cd FileOrganizer -
Run the application:
python file_organizer.py
| Method | Description | Example Structure |
|---|---|---|
| Category | Sorts by file type | Images, Documents, Code |
| Date | Sorts by modification date | ByDate 2024 December 25 |
| Size | Sorts by file size | BySize Tiny, BySize Large |
| Letter | Sorts by first letter | ByLetter A, ByLetterB |
| Smart | Category + Date combination | ByDate 2024 December 25 Images |
๐ท Images - jpg, png, gif, bmp, svg, ico, webp, raw, tiff, heic
๐ Documents - pdf, docx, doc, txt, md, rtf, odt, tex
๐ป Code - py, js, html, css, cpp, java, php, rb, go, json, xml
๐๏ธ Archives - zip, rar, 7z, tar, gz, bz2, xz, iso
๐ฌ Videos - mp4, mkv, avi, mov, wmv, flv, webm, m4v
๐ต Music - mp3, wav, flac, aac, ogg, m4a, wma, opus
โ๏ธ Executables - exe, msi, app, deb, rpm, dmg, pkg
๐ Spreadsheets - xls, xlsx, csv, ods, numbers
๐ฝ๏ธ Presentations - ppt, pptx, odp, key
๐ Ebooks - epub, mobi, azw, fb2
๐๏ธ Databases - db, sqlite, sql, mdb
๐พ Backups - bak, old, backup, tmp
๐จ Design - psd, ai, eps, sketch, fig, xd
๐ค Fonts - ttf, otf, woff, woff2, eot
๐ง Email - eml, msg, pst
๐ Web - html, htm, css, js, php
๐ฑ Mobile - apk, ipa, xapk
๐ฎ Games - gam, save, dat
๐ผ๏ธ Vector - ai, eps, svg, cdr
๐ฆ Packages - whl, egg, gem, jar
๐ Logs - log, out, err
๐ง Config - cfg, conf, ini, env, properties
โ Others - Any other file types
======================================================================
๐๏ธ FILE ORGANIZER PRO - Interactive Mode
======================================================================
๐ Enter folder path to organize:
C:\Users\YourName\Downloads
๐ Select Organization Method:
- By Category (Images, Documents, Code, etc.)
- By Date (Year/Month/Day structure)
- By Size (Tiny to Huge)
- By First Letter (A-Z)
- Smart (Category + Date combination)
- Recursive (organize all subfolders)
๐ Choose (1-6): 1
๐ Perform dry run first? (y/n): n
======================================================================
๐ FILE ORGANIZER PRO - C:\Users\YourName\Downloads
======================================================================
โ
Moved: vacation.jpg โ ๐ท Images/vacation.jpg
โ
Moved: resume.pdf โ ๐ Documents/resume.pdf
โ
Moved: script.py โ ๐ป Code/script.py
โ
Moved: music.mp3 โ ๐ต Music/music.mp3
Progress: 50/50
======================================================================
๐ ORGANIZATION SUMMARY
======================================================================
๐ Directory: C:\Users\YourName\Downloads
โฑ๏ธ Time taken: 3.45 seconds
โ
Files moved: 48
โญ๏ธ Files skipped: 2
๐ฆ Total size moved: 245.67 MB
๐ Duplicates handled: 3
โ Errors: 0
๐ New folders created: 8
๐ Created folders:
โข ๐ท Images
โข ๐ Documents
โข ๐ป Code
โข ๐ต Music
โข ๐ฌ Videos
โข ๐๏ธ Archives
โข โ Others
| Argument | Description |
|---|---|
| directory | Path to folder to organize |
| --method, -m | Organization method (category, date, size, letter, smart) |
| --dry-run, -d | Preview changes without moving files |
| --recursive, -r | Process subdirectories recursively |
| --undo, -u | Undo last organization operation |
| --quiet, -q | Reduce output verbosity |
| --interactive, -i | Launch interactive mode |
The tool uses SHA256 hashing to identify duplicate files and handles them by adding number suffixes.
Every organization operation is logged and can be undone: python file_organizer.py ~/Downloads --undo
All operations are saved in organization_history.json for future reference.
Detailed logs are saved as organizer_log_YYYYMMDD_HHMMSS.txt with timestamps.
- Tiny: < 100 KB
- Small: 100 KB - 1 MB
- Medium: 1 MB - 10 MB
- Large: 10 MB - 100 MB
- Very Large: 100 MB - 1 GB
- Huge: > 1 GB
- Ignores system files (desktop.ini, Thumbs.db, .DS_Store)
- Skips organization folders to prevent recursion
- Handles permission errors gracefully
- Prevents moving the script itself
- Duplicate filename handling
Downloads/
โโโ vacation_2024.jpg
โโโ resume_final.pdf
โโโ project_script.py
โโโ data_analysis.csv
โโโ setup.exe
โโโ random_file.xyz
Downloads/
โโโ ๐ท Images/
โ โโโ vacation_2024.jpg
โโโ ๐ Documents/
โ โโโ resume_final.pdf
โ โโโ data_analysis.csv
โโโ ๐ป Code/
โ โโโ project_script.py
โโโ โ๏ธ Executables/
โ โโโ setup.exe
โโโ โ Others/
โโโ random_file.xyz
file-organizer-pro/
โ
โโโ file_organizer.py # Main application
โโโ README.md # Documentation
โโโ LICENSE # MIT License
โโโ .gitignore # Git ignore file
- Run terminal as administrator (Windows) or use sudo (Linux/Mac)
- Close any programs using the files
- Check if files are in use by another program
- Verify the directory path is correct
- Try dry run mode first: --dry-run
- Ensure you haven't moved or deleted the history file
- History file is located in the organized directory: organization_history.json
- Files per second: 50-100 files (depending on storage speed)
- Memory usage: ~50 MB for 10,000 files
- Supports: Unlimited file count
Contributions are welcome!
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
Distributed under the MIT License. See LICENSE file for more information.
Your Name - 123razz321@gmail.com
Project Link: https://github.com/poisonmunna/FileOrganizer
If this project helped you organize your files, please give it a star on GitHub!
Made with Python | Keep your files organized!

