CLI tool for automatically sorting files into subfolders. Customisable with own rules with function to restore the old structure
Project description
Sortifile
Sortifile is a simple yet powerful command-line tool to automatically sort files in a directory into categorized subfolders based on customizable rules. It supports undo functionality to restore the original file structure, making file organization effortless and reversible.
Features
- Automatically sort files by extension or custom rules
- Supports recursive scanning of directories
- Undo the last sorting operation to restore file locations
- Dry-run mode to preview changes without moving files
- Customizable rules via JSON configuration
- Minimal dependencies, easy to install and use
Installation
Install via pip:
pip install sortifile
Or install from source:
git clone https://github.com/alphascg/sortifile.git
cd sortifile
pip install .
Usage
Basic usage:
sortifile /path/to/your/folder
Options
--dry-run, -d Show what would be moved without actually moving files
--silent, -s Suppress output messages during the operation
--config, -c Specify a custom JSON rules file (optional)
Undo last operation:
If you want to revert the last sorting operation:
sortifile undo
Configuration Rules
The rules file should be a JSON mapping of file extensions to target folders. Example:
{
".pdf": "Documents",
".jpg": "Pictures",
".py": "Code"
}
If a file's extension is not found in the rules, it will be moved to an Others folder.
License
MIT License - see the LICENSE file for details.
Author
alphascg - GitHub
Contribute
Contributions, issues, and feature requests are welcome! Feel free to check issues page.
Disclaimer
This tool is provided “as is” without warranty of any kind. Use at your own risk.
If you read the whole README, you are are breathtaking!
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
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 sortifile-1.1.3.tar.gz.
File metadata
- Download URL: sortifile-1.1.3.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cabb27225cf47c7dcf23e11746d4c384436e076cac9ad436e467fb67c79a9f00
|
|
| MD5 |
1c85fefe784330561d3a357c195c73be
|
|
| BLAKE2b-256 |
7bf6db2be93ea82c1d7428fbcc1fad8ab81378ce11685e8807b317691995c43a
|
File details
Details for the file sortifile-1.1.3-py3-none-any.whl.
File metadata
- Download URL: sortifile-1.1.3-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29209487576136c43d5aaa271c701fa136b8f4bb755c59942854f651640807f4
|
|
| MD5 |
b0ca98c097b99a46f130931733dde9c0
|
|
| BLAKE2b-256 |
f0f790ae36f50de9fab0f52557ecc32a2489afdb3125ddd32bc3fa1e80bcc9d0
|