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.2.tar.gz (4.7 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.2-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sortifile-1.1.2.tar.gz
  • Upload date:
  • Size: 4.7 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.2.tar.gz
Algorithm Hash digest
SHA256 eac5672509b1c46e195a4666ab8154aef8651134be9d68f38ea2805a3359c2ad
MD5 e54fd84b3b98ed65c2f017d1dd7b2697
BLAKE2b-256 01502b7ae6a25b88369eaa7dc863b75324487294bd16837cb3af09a5b766e0d6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sortifile-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.9 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cd4760d65fe8315e5361ed3a886717fd373e8761a2d39526d3d4df1c30706411
MD5 8310d661807c752d17ee21c8de67a7e0
BLAKE2b-256 db5152a88e46a60ef8b9ced19fd9687d8867e6f07c8a50e70147211c2ba1b763

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