Skip to content

Latest commit

Β 

History

History
115 lines (82 loc) Β· 3.12 KB

README.md

File metadata and controls

115 lines (82 loc) Β· 3.12 KB

πŸ—‚οΈ File Organizer

License: MIT Python 3.6+

A powerful CLI application that helps you organize your messy directories by automatically categorizing and moving files based on their extensions. Say goodbye to cluttered folders! πŸš€

✨ Features

  • πŸ“ Automatically organizes files into appropriate categories
  • 🎨 Support for common file types (documents, images, videos, audio, etc.)
  • βš™οΈ Customizable file extension mappings
  • πŸ”„ Progress tracking with rich console output
  • 🎯 Simple and intuitive command-line interface

πŸš€ Installation

  1. Clone the repository:
git clone https://github.com/tahadnan/File-Organizer.git
cd File-Organizer
  1. Install required dependencies:
pip install -r requiremts.txt

πŸ’‘ Usage

Basic usage to organize a directory:

python main.py /path/to/directory

Command Line Arguments

  • dirname: The directory to be organized (required)
  • -c, --custom-mapping: Path to a JSON file with custom extension mappings
  • -o, --overwrite: Overwrite default mappings with custom ones completely
  • -v, --verbose: Display detailed progress instead of a progress bar

Examples

  1. Organize current directory with default settings:
python <script_path> .
  1. Organize with custom mappings:
python main.py /Downloads -c custom_mappings.json
  1. Use verbose output:
python main.py /Documents -v

πŸ“ Custom Mappings

You can create your own extension mappings using a JSON file. Here's an example structure:

{
    "work": [".doc", ".docx", ".pdf"],
    "images": [".png", ".jpg", ".gif"],
    "custom_category": [".xyz", ".abc"]
}

πŸ“‚ Default Categories

The organizer comes with the following default categories:

  • πŸ“„ Documents (.pdf, .doc, .docx, .txt, etc.)
  • πŸ–ΌοΈ Images (.jpg, .png, .gif, etc.)
  • πŸŽ₯ Videos (.mp4, .avi, .mkv, etc.)
  • 🎡 Audio (.mp3, .wav, .flac, etc.)
  • πŸ“¦ Archives (.zip, .rar, .7z, etc.)
  • πŸ’» Code (.py, .java, .cpp, etc.)
  • βš™οΈ Executables (.exe, .msi, .app, etc.)
  • πŸ—„οΈ Databases (.db, .sqlite, etc.)

⚠️ Important Notes

  • The program will create directories for each category as needed
  • Files with unsupported extensions will be skipped
  • Existing files in destination folders won't be overwritten
  • Use the -v flag to see detailed progress and any potential errors

🀝 Contributing

Contributions are welcome! Feel free to:

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/improvement)
  3. Make your changes
  4. Submit a Pull Request

πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Built with Rich for beautiful terminal output
  • Inspired by the need for a clean and organized file system

Made with ❀️ by Taha Adnan