Skip to main content

Organises a certain folder in a few seconds

Project description

Dirganise

A CLI tool written in Python that organizes a messy folder by file type.

Python License: MIT Version Platform


Features

  • Automatic sorting — moves files into categories: Images, Videos, Audio, Documents, Code, Compressed, Installers, Fonts, and Others
  • Custom rules — define your own extension-to-folder mappings via a JSON file
  • Dry-run mode — preview what would happen without touching the filesystem
  • Undo — revert the last organization with a single command
  • Conflict handling — appends a timestamp automatically if a file with the same name already exists

Installation

[!TIP] Compatibility: This program can run in every platform that supports Python 3.10+

pip install dirganise

Or clone and install locally:

git clone https://github.com/yourusername/dirganise.git
cd dirganise
pip install -e .

Usage

# Organize a folder
dirganise /path/to/folder

# Preview changes without moving anything
dirganise --dry-run

# Undo the last organization
dirganise --undo

# Use custom rules from a JSON file
dirganise --rules custom_rules.json

Options

Flag Short Description
--dry-run -n Preview changes without modifying the filesystem
--undo Revert the last dirganise operation in this folder
--rules FILE Path to a JSON file with custom extension-to-folder rules
--version -v Prints the version of dirganise being used

Default Organization Rules

Category Extensions
Images .jpg .jpeg .png .gif .webp .svg .bmp .tiff .heic
Videos .mp4 .mov .avi .mkv .wmv .flv
Audio .mp3 .wav .flac .aac .ogg .m4a
Documents .pdf .docx .xlsx .pptx .txt .odt .rtf
Code .py .js .ts .html .css .json .csv .xml .sh .bat .ps1
Compressed .zip .rar .7z .tar .gz .bz2
Executables .exe .msi .dmg .pkg .deb .rpm
Fonts .ttf .otf .woff .woff2
Others Everything else

Custom Rules

Create a .json file mapping extensions to folder names:

{
  ".psd": "Design",
  ".ai": "Design",
  ".blend": "3D",
  ".csv": "Data"
}

Custom rules override the defaults for any matching extension. All other defaults remain active.

dirganise ~/Downloads --rules my_rules.json

Undo

After every organization, dirganise saves a log file (.dirganise_op.json) in the target folder. Use it to restore the original state:

dirganise /path/to/folder --undo

The log file is automatically deleted after a successful undo.


Example

$ dirganise ~/Downloads --dry-run

 dirganise  >  /home/user/Downloads

Images/
  photo_2024.jpg
  screenshot.png

Documents/
  report.pdf
  notes.txt

Code/
  script.py

Total files to move: 5

[Preview] No changes have been made to the file system.

Development

git clone https://github.com/yourusername/dirganise.git
cd dirganise
pip install -e .

Contributions, issues, and feature requests are highly welcome. Feel free to open an issue or submit a pull request.


License

MIT © 2026

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

dirganise-1.1.0b2.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

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

dirganise-1.1.0b2-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file dirganise-1.1.0b2.tar.gz.

File metadata

  • Download URL: dirganise-1.1.0b2.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dirganise-1.1.0b2.tar.gz
Algorithm Hash digest
SHA256 611c8e794a0c5d0541a73f06a4e664fde7cd7d36c4cfb7fc741aa0b28d4a451b
MD5 ab364f6b4180a2f6c9066a7203b49b4d
BLAKE2b-256 2838c0055f292d26703a52ec502ca6d67413f8d9e2aa18ac996f74984a0d075f

See more details on using hashes here.

Provenance

The following attestation bundles were made for dirganise-1.1.0b2.tar.gz:

Publisher: pypi-publish.yml on dxvampi/dirganise

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dirganise-1.1.0b2-py3-none-any.whl.

File metadata

  • Download URL: dirganise-1.1.0b2-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dirganise-1.1.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 45162678cdb34488ea49a5e0e9c1deaae1a8d2917c7f31a0fbcfd366459c7f27
MD5 85142f4a33ace6dbdc8889598800f3fc
BLAKE2b-256 09ec2614b4eccb749df81fa3bc6e47feb0bda06d66dac30f01f2f48f9a5ad775

See more details on using hashes here.

Provenance

The following attestation bundles were made for dirganise-1.1.0b2-py3-none-any.whl:

Publisher: pypi-publish.yml on dxvampi/dirganise

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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