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.1.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.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sortifile-1.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 57aa6239a71d2fdcc446d48d5b0602747978ad0a0e44e02eb22f7c343226de5a
MD5 434873f9ff74e3f477b024817d0d5266
BLAKE2b-256 e100a4fb4d43fe56dbee60256bf873b1dbf690e59b563e91fa1946abfe6fa0d9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sortifile-1.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f67612ca19ec7e63dab865330edba0539f3bb9698d3d80a090091c86ef4569a6
MD5 8c2caf759aecb84825f277fd25a4d72e
BLAKE2b-256 ac0315d2f236cbb9973cd1bdd44900f0fe89641d634730750d96cbf23e1410a1

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