A powerful command-line Python application that automates common file management tasks โ organize files by type, bulk-rename, clean empty folders, and generate detailed statistics with full operation logging.
- Features
- Technologies Used
- Installation
- How to Run
- Project Structure
- Sample Input / Output
- Screenshots
- Future Improvements
- License
| # | Feature | Description |
|---|---|---|
| 1 | ๐ Organize Files | Automatically sort files into categorized folders (Images, Documents, Videos, Music, Archives, Programs, Others) based on file extension |
| 2 | โ๏ธ Bulk Rename | Rename all files in a folder with a custom prefix and sequential numbering (Report_001.pdf, Report_002.docx, โฆ) |
| 3 | ๐ Delete Empty Folders | Recursively scan and remove empty sub-directories |
| 4 | ๐ Folder Statistics | Display total files, folders, category breakdown, total size, and largest / smallest files |
| 5 | ๐ Operation Log | View timestamped logs of every action performed |
| 6 | ๐ค Export to CSV | Export folder statistics to a CSV report |
- ๐จ Colorized terminal output โ ANSI escape codes with zero external dependencies
- ๐ Progress bar โ animated
[โโโโโโโโโโโโ] 65.0%for long operations - ๐ก Duplicate handling โ auto-suffixes filenames to prevent overwrites
- ๐ค CSV export โ timestamped statistical reports
- ๐ง Centralized configuration โ all extension categories in
config.pyfor easy customization
| Technology | Purpose |
|---|---|
| Python 3.10+ | Core language |
os |
File / directory operations (listdir, walk, rename, rmdir, makedirs, path) |
shutil |
Moving files across directories |
logging |
Persistent operation logging to logs/operations.log |
csv |
Statistics export |
sys |
Terminal control (progress bar rendering) |
datetime |
Timestamped CSV filenames |
No external dependencies required. The project uses only the Python standard library.
# 1. Clone the repository
git clone https://github.com/your-username/Smart-File-Automation-Organizer.git
cd Smart-File-Automation-Organizer
# 2. (Optional) Create a virtual environment
python -m venv venv
source venv/bin/activate # macOS / Linux
venv\Scripts\activate # Windows
# 3. Install dependencies (none required โ standard library only)
pip install -r requirements.txt- Python 3.10 or higher
- No third-party packages needed
python main.pyYou'll see an interactive menu:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ ๐ SMART FILE ORGANIZER ๐ โ
โ v1.0.0 โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
MAIN MENU
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
1. ๐ Organize Files by Extension
2. โ๏ธ Rename Multiple Files
3. ๐ Delete Empty Folders
4. ๐ Display Folder Statistics
5. ๐ View Operation Log
6. ๐ค Export Statistics to CSV
0. ๐ช Exit
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Choose an option:
Smart-File-Automation-Organizer/
โ
โโโ main.py # Entry point โ CLI menu & dispatch
โโโ config.py # Extension mappings, colours, constants
โโโ organizer.py # Feature 1: Organize files by extension
โโโ renamer.py # Feature 2: Bulk rename files
โโโ cleaner.py # Feature 3: Delete empty folders
โโโ statistics.py # Feature 4: Folder statistics & CSV export
โโโ logger.py # Logging setup (logs/operations.log)
โโโ utils.py # Shared helpers (validation, progress bar)
โ
โโโ requirements.txt # Dependencies (standard library only)
โโโ README.md # This file
โโโ LICENSE # MIT License
โโโ .gitignore # Git ignore rules
โ
โโโ logs/ # Auto-created operation logs
โ โโโ operations.log
โ
โโโ sample_folder/ # Test files for quick demo
โ โโโ photo1.jpg
โ โโโ wallpaper.png
โ โโโ resume.pdf
โ โโโ notes.txt
โ โโโ spreadsheet.xlsx
โ โโโ data.csv
โ โโโ movie.mp4
โ โโโ song.mp3
โ โโโ archive.zip
โ
โโโ screenshots/ # Screenshots for documentation
Input:
๐ Enter the folder to organize: ./sample_folder
Organize files in './sample_folder'? [y/N]: y
Before:
sample_folder/
โโโ photo1.jpg
โโโ wallpaper.png
โโโ resume.pdf
โโโ notes.txt
โโโ spreadsheet.xlsx
โโโ data.csv
โโโ movie.mp4
โโโ song.mp3
โโโ archive.zip
Output:
โน Found 9 file(s). Organizingโฆ
[โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ] 100.0%
โ 9 file(s) organized successfully.
After:
sample_folder/
โโโ Images/
โ โโโ photo1.jpg
โ โโโ wallpaper.png
โโโ Documents/
โ โโโ resume.pdf
โ โโโ notes.txt
โ โโโ spreadsheet.xlsx
โ โโโ data.csv
โโโ Videos/
โ โโโ movie.mp4
โโโ Music/
โ โโโ song.mp3
โโโ Archives/
โ โโโ archive.zip
โโโ Programs/
โโโ Others/
Input:
๐ Enter the folder containing files to rename: ./Documents
๐ท Enter new filename prefix: Project
Rename all files in './Documents' with prefix 'Project'? [y/N]: y
Before:
Documents/
โโโ resume.pdf
โโโ notes.txt
โโโ spreadsheet.xlsx
โโโ data.csv
Output:
โน Renaming 4 file(s)โฆ
[โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ] 100.0%
โ 4 file(s) renamed successfully.
After:
Documents/
โโโ Project_001.csv
โโโ Project_002.pdf
โโโ Project_003.txt
โโโ Project_004.xlsx
Input:
๐ Enter the root folder to scan: ./TestFolder
Delete all empty sub-folders inside './TestFolder'? [y/N]: y
Folder structure before:
TestFolder/
โโโ Old/ (empty)
โโโ Backup/ (empty)
โโโ Reports/
โ โโโ Q1.pdf
โโโ Empty1/ (empty)
โโโ Empty2/ (empty)
Output:
๐ Removed: TestFolder/Old
๐ Removed: TestFolder/Backup
๐ Removed: TestFolder/Empty1
๐ Removed: TestFolder/Empty2
โ 4 empty folder(s) deleted.
Input:
๐ Enter the folder to analyse: ./ProjectFiles
Output:
๐ Total Files 35
๐ Total Folders 12
๐ผ Images 8
๐ Documents 14
๐ฌ Videos 5
๐ต Music 4
๐ฆ Archives 2
โ Programs 0
๐ Others 2
๐พ Total Size 452.38 MB
๐บ Largest File presentation.mp4 (198.50 MB)
๐ป Smallest File notes.txt (45 B)
Output (color-coded in terminal):
2026-07-01 18:32:15 | INFO | SESSION | Application started (v1.0.0)
2026-07-01 18:32:18 | INFO | ORGANIZE | Started โ target: C:\sample_folder
2026-07-01 18:32:18 | INFO | ORGANIZE | Moved 'photo1.jpg' โ Images/
2026-07-01 18:32:18 | INFO | ORGANIZE | Moved 'resume.pdf' โ Documents/
2026-07-01 18:32:18 | INFO | ORGANIZE | Moved 'movie.mp4' โ Videos/
2026-07-01 18:32:18 | INFO | ORGANIZE | Moved 'song.mp3' โ Music/
2026-07-01 18:32:18 | INFO | ORGANIZE | Moved 'archive.zip' โ Archives/
2026-07-01 18:32:18 | INFO | ORGANIZE | Completed โ 9 file(s) moved
2026-07-01 18:33:01 | INFO | RENAME | Started โ folder: C:\Documents, prefix: 'Project'
2026-07-01 18:33:01 | INFO | RENAME | 'resume.pdf' โ 'Project_001.pdf'
2026-07-01 18:33:01 | INFO | RENAME | 'notes.txt' โ 'Project_002.txt'
2026-07-01 18:33:01 | INFO | RENAME | Completed โ 4 file(s) renamed
2026-07-01 18:34:12 | INFO | CLEAN | Started โ target: C:\TestFolder
2026-07-01 18:34:12 | INFO | CLEAN | Deleted empty folder: C:\TestFolder\Old
2026-07-01 18:34:12 | INFO | CLEAN | Completed โ 4 folder(s) deleted
2026-07-01 18:35:00 | INFO | STATS | Completed โ 35 files, 12 folders, 452.38 MB total
Output:
โ Statistics exported to ./ProjectFiles/folder_stats_20260701_183500.csv
Generated CSV contents:
| Metric | Value |
|---|---|
| Total Files | 35 |
| Total Folders | 12 |
| Total Size (bytes) | 474439680 |
| Largest File | presentation.mp4 |
| Smallest File | notes.txt |
| Category | Count |
|---|---|
| Archives | 2 |
| Documents | 14 |
| Images | 8 |
| Music | 4 |
| Others | 2 |
| Videos | 5 |
- Undo last operation โ maintain a journal to reverse the most recent action
- Configuration file โ YAML/JSON config for custom extension categories
- Scheduled automation โ watch a folder and auto-organize on file arrival
- GUI version โ Tkinter or web-based interface
- Dry-run mode โ preview changes without moving/renaming files
- Multi-language support โ i18n for menu strings
- Search functionality โ find files by name, size, or date across directories
This project is licensed under the MIT License โ see the LICENSE file for details.
Built as an internship-level project demonstrating proficiency in:
- Python
osmodule & file system operations - Exception handling & defensive programming
- The
loggingstandard library module - Modular, PEP 8-compliant code architecture
- CLI user experience design
Made with โค๏ธ in Python








