Skip to content

BoddapuLokesh/Automatic-File-Organiser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Automatic File Organizer

A powerful and user-friendly tool to automatically organize your files into categorized folders based on their file types. Available in both command-line and GUI versions for maximum flexibility.

🌟 Features

  • Smart Categorization: Automatically sorts files into predefined categories (Documents, Images, Videos, Music, etc.)
  • Dual Interface: Choose between command-line automation or intuitive GUI
  • Safe Operations: Files are moved (not copied) with duplicate handling and no overwriting
  • Progress Tracking: Real-time progress bar and detailed results summary in GUI mode
  • Comprehensive Logging: All operations logged for troubleshooting and verification
  • Cross-Platform: Works seamlessly on Windows, macOS, and Linux
  • Flexible: Handles unknown file types by creating extension-based folders

🚀 Quick Start

Prerequisites

  • Python 3.6 or higher
  • tkinter (included with most Python installations)

Check your Python version:

python --version

Installation

  1. Clone or download the project files
  2. Navigate to the project directory

📖 Usage Guide

Method 1: Command Line (Automation)

Perfect for batch processing and scripting:

python file_organizer.py

When prompted, enter the directory path you want to organize:

-----Basic File Organizer-----
Enter the source directory path: /Users/username/Downloads

Example with direct path:

python file_organizer.py /path/to/your/folder

Method 2: GUI Version (Interactive)

Ideal for visual file management:

python file_organizer_gui.py

Steps:

  1. Click Browse to select a folder
  2. Click Scan Files to preview what will be organized
  3. Review the file list and categories
  4. Click Organize Files to move files into categorized folders
  5. View progress bar and results summary

📁 File Categories

Predefined Categories

Category File Extensions
Documents .pdf, .doc, .docx, .txt, .xls, .xlsx, .ppt, .pptx, .odt, .rtf
Images .jpg, .jpeg, .png, .gif, .bmp, .tiff, .svg, .webp
Videos .mp4, .avi, .mov, .wmv, .flv, .mkv, .webm
Music .mp3, .wav, .aac, .flac, .ogg, .wma
Code .py, .js, .html, .css, .java, .cpp, .c
Archives .zip, .tar.gz, .rar, .7z
Executables .exe, .msi, .dmg, .deb

Special Handling

  • MISC: Files without extensions
  • Extension Folders: Unknown file types get their own folder (e.g., .csv files go to csv/ folder)

🔧 Example Workflow

Before Organization:

Downloads/
├── vacation_photo.jpg
├── report.pdf
├── song.mp3
├── movie.mp4
├── script.py
└── data.csv

After Organization:

Downloads/
├── Documents/
│   └── report.pdf
├── Images/
│   └── vacation_photo.jpg
├── Music/
│   └── song.mp3
├── Videos/
│   └── movie.mp4
├── py/
│   └── script.py
├── csv/
│   └── data.csv
└── file_organizer.log

🛡️ Safety Features

Duplicate File Handling

When duplicate filenames are encountered:

  • Original: report.pdf → Stays as report.pdf
  • Duplicate: report.pdf → Renamed to report_1.pdf

Protected Elements

  • Hidden files: Files starting with . are skipped
  • Subdirectories: Existing folder structure is preserved
  • File integrity: No file content is modified
  • No overwrites: Files are safely renamed if conflicts occur

📊 Logging and Monitoring

All operations are logged in file_organizer.log:

2025-08-31 10:30:15,123 - INFO - Started file organization process
2025-08-31 10:30:15,124 - INFO - Source directory: /Users/username/Downloads
2025-08-31 10:30:15,126 - INFO - Found file: vacation_photo.jpg, extension: .jpg, category: Images
2025-08-31 10:30:15,127 - INFO - Moved file: vacation_photo.jpg to /Users/username/Downloads/Images

⚠️ Troubleshooting

Common Issues

"Directory does not exist"

  • Check path for typos
  • Use absolute paths for reliability

"Not a directory"

  • Ensure you're pointing to a folder, not a file

Permission errors

  • Verify read/write permissions
  • Run with appropriate privileges if needed

💡 Best Practices

  1. Backup Important Data: Always backup critical files before organizing
  2. Test First: Try the organizer on a small test directory
  3. Review Logs: Check the log file after operations
  4. Regular Use: Run periodically to maintain organized directories
  5. Custom Categories: Modify FILE_CATEGORIES in the script for custom file types

🛠️ Advanced Usage

  • Batch Processing: Run on multiple directories sequentially
  • Automation: Set up scheduled tasks for automatic organization
  • Customization: Edit file categories and extensions in the source code
  • Integration: Incorporate into larger file management workflows

📋 Project Structure

file_organizer.py           # Command-line version
file_organizer_gui.py       # GUI version with tkinter interface
README.md                   # This comprehensive guide

🤝 Support

If you encounter issues:

  1. Check the log file for detailed error messages
  2. Verify directory permissions and paths
  3. Review this guide for common solutions
  4. Ensure Python and tkinter are properly installed

Transform your cluttered directories into organized, categorized file systems with just a few clicks! 🎯

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages