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
From Source
git clone https://github.com/yourusername/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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fileorganizer_farhan-0.1.0.tar.gz.
File metadata
- Download URL: fileorganizer_farhan-0.1.0.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d10fb15c82881e433b0ce371d177aa50cd976266fe5418dc3320784c30eb432a
|
|
| MD5 |
f04678b890b8910a27098dfbc2cbabfe
|
|
| BLAKE2b-256 |
2d5d068b2136867c895a054229042813d9804a600735cb5d8726a762c288dfe8
|
File details
Details for the file fileorganizer_farhan-0.1.0-py3-none-any.whl.
File metadata
- Download URL: fileorganizer_farhan-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0b447e672ffce817587330d757a8e00993a9c61417ac432e92fce3af5c1851b
|
|
| MD5 |
7d47bb0989a8128026c00e770802e5e7
|
|
| BLAKE2b-256 |
77d2086b3b46fc01a7c8d9729acb2cf827639d8f350ac4415b10cea3104ed6c4
|