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.
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
Release history Release notifications | RSS feed
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 dirganise-1.1.0b1.tar.gz.
File metadata
- Download URL: dirganise-1.1.0b1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f64b12efcf00ee7ebfb4b0ad5a832b6bef410cf229424eeec50da92053561cdc
|
|
| MD5 |
31eababcb09bde825b5fca566f7f5070
|
|
| BLAKE2b-256 |
9fb2a6de0a977643068856b70ab3a085c67e63d1329295a88ef5507ee8e56749
|
Provenance
The following attestation bundles were made for dirganise-1.1.0b1.tar.gz:
Publisher:
pypi-publish.yml on dxvampi/dirganise
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dirganise-1.1.0b1.tar.gz -
Subject digest:
f64b12efcf00ee7ebfb4b0ad5a832b6bef410cf229424eeec50da92053561cdc - Sigstore transparency entry: 1630640002
- Sigstore integration time:
-
Permalink:
dxvampi/dirganise@702855fc4eab29ae8abe707838b18d2d164434ae -
Branch / Tag:
refs/tags/v1.1.0b1 - Owner: https://github.com/dxvampi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@702855fc4eab29ae8abe707838b18d2d164434ae -
Trigger Event:
release
-
Statement type:
File details
Details for the file dirganise-1.1.0b1-py3-none-any.whl.
File metadata
- Download URL: dirganise-1.1.0b1-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2fe6bae90a3907758423bd478513571d758edc3cf37fa3c8067deb6523caa83
|
|
| MD5 |
51e3b26d325587e606629dc2a672611a
|
|
| BLAKE2b-256 |
2acfda74959fc0acf25030ea045ddaf99aa7d26452d0a78eae4174fedb9a7eb4
|
Provenance
The following attestation bundles were made for dirganise-1.1.0b1-py3-none-any.whl:
Publisher:
pypi-publish.yml on dxvampi/dirganise
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dirganise-1.1.0b1-py3-none-any.whl -
Subject digest:
e2fe6bae90a3907758423bd478513571d758edc3cf37fa3c8067deb6523caa83 - Sigstore transparency entry: 1630640040
- Sigstore integration time:
-
Permalink:
dxvampi/dirganise@702855fc4eab29ae8abe707838b18d2d164434ae -
Branch / Tag:
refs/tags/v1.1.0b1 - Owner: https://github.com/dxvampi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@702855fc4eab29ae8abe707838b18d2d164434ae -
Trigger Event:
release
-
Statement type: