Skip to main content

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

sortifile-1.1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

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

sortifile-1.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file sortifile-1.1.0.tar.gz.

File metadata

  • Download URL: sortifile-1.1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for sortifile-1.1.0.tar.gz
Algorithm Hash digest
SHA256 829f8cf2afcc1bf89f7b013a3aad909fe458b13ad88e25daf46c1e758e3995bc
MD5 ee9598c14ffa3e345da7370761c48463
BLAKE2b-256 24eae342637d4cc19a54e1cffe538b04514db8ea58b9fb3b4c749dfb5ce3136c

See more details on using hashes here.

File details

Details for the file sortifile-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: sortifile-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for sortifile-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f11daec5130f7004f8627f8f8a4b58f5af7bd8776f7c68ef2d3a4950a5cb8314
MD5 810b1ccfa7d25f5c4969a7bbf21e108b
BLAKE2b-256 c41aa8b89188c12c605cf996e0c3beb4e026bf4eddba7a8d19cc614977daa683

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