Skip to main content

A tool to organize messy files into categorized folders

Project description

FileOrganizer

A Python package that organizes messy files in a folder into categorized subfolders.

Features

  • 📁 Automatically categorizes files based on extension
  • 🏷️ Supports common file types: images, videos, documents, audio, code, archives
  • 🔄 Creates subfolders automatically if they don't exist
  • 🔄 Handles duplicate filenames by adding a suffix (_1, _2, etc.)
  • 📝 Logs all actions (old path → new path) into a log file
  • ↩️ Undo functionality to revert the last organization operation
  • 🧰 Simple command-line interface

Installation

From PyPI

pip install fileorganizer-farhan

From Source

git clone https://github.com/Farhanahmad-kust/fileorganizer.git
cd fileorganizer
pip install -e .

Usage

Command Line Interface

Organize files in a directory:

fileorganizer organize /path/to/messy/directory

Add the -v or --verbose flag for detailed output:

fileorganizer organize /path/to/messy/directory --verbose

Undo the last organization operation:

fileorganizer undo /path/to/organized/directory

As a Python Package

You can also use FileOrganizer in your Python scripts:

from fileorganizer import FileOrganizer

# Initialize the organizer with the target directory
organizer = FileOrganizer("/path/to/messy/directory")

# Organize files
moved_files = organizer.organize()

# Undo the last operation
undone_files = organizer.undo_last_operation()

File Categories

FileOrganizer sorts files into the following categories:

  • images: .jpg, .jpeg, .png, .gif, .bmp, .svg, .tiff, .webp
  • documents: .doc, .docx, .pdf, .txt, .rtf, .odt, .md, .csv, .xls, .xlsx, .ppt, .pptx
  • audio: .mp3, .wav, .flac, .aac, .ogg, .wma, .m4a
  • video: .mp4, .avi, .mov, .wmv, .mkv, .flv, .webm, .m4v
  • code: .py, .js, .html, .css, .java, .c, .cpp, .h, .php, .rb, .go, .rs, .ts, .json, .xml
  • archives: .zip, .rar, .7z, .tar, .gz, .bz2, .xz
  • others: Any file type not listed above

License

MIT License

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fileorganizer_farhan-0.1.1.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fileorganizer_farhan-0.1.1-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file fileorganizer_farhan-0.1.1.tar.gz.

File metadata

  • Download URL: fileorganizer_farhan-0.1.1.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for fileorganizer_farhan-0.1.1.tar.gz
Algorithm Hash digest
SHA256 adaa92ad4f98440b9a0ef552e7d20f8e05349ef99989be73f94ea8a5d142b418
MD5 008ae63d33d7b99c648d97f5fc2d8d51
BLAKE2b-256 25282fbc68968d835816db4769c4684e4b4855b674286b145acc03c7b52339ac

See more details on using hashes here.

File details

Details for the file fileorganizer_farhan-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for fileorganizer_farhan-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eb767dd1bb3b203ddc5e4abe394b16434a1cd493af6b2d7b86ff59e414325146
MD5 52c8c1d7e7282499c8705ed23cf424fc
BLAKE2b-256 b1178eaa925f9537fa89bc112fd56c115aeeff27a0b12bc01168a8bbc3a0424f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page