File Organizer Tool
A powerful Python tool to organize files in directories based on their extensions. Features include dry-run preview, undo capability, recursive organization, and custom configuration.
Installation
pip install file-organizer-tool
For YAML config support:
pip install file-organizer-tool[yaml]
For development:
pip install file-organizer-tool[dev]
Quick Start
Command Line
# Basic usage - organize current directory
file-organizer-tool .
# Preview changes without moving files
file-organizer-tool /path/to/folder --dry-run
# Organize with detailed output
file-organizer-tool /downloads --verbose
# Organize subdirectories recursively
file-organizer-tool /messy-folder --recursive
# Undo the last organization
file-organizer-tool /organized-folder --undo
Python Script
from file_organizer_tool import organize_files
# Basic organization
result = organize_files("/path/to/directory")
print(result.summary())
# With options
result = organize_files(
"/downloads",
dry_run=True,
verbose=True,
recursive=True,
on_conflict='rename' # or 'skip', 'overwrite'
)
CLI Options
| Option | Short | Description |
|---|---|---|
--dry-run |
-n |
Preview changes without moving files |
--verbose |
-v |
Show detailed output for each file |
--recursive |
-r |
Organize files in subdirectories |
--dest |
-d |
Custom destination directory |
--config |
-c |
Path to custom config file (JSON/YAML) |
--exclude |
-e |
Glob patterns to exclude |
--on-conflict |
Handle duplicates: skip, rename, overwrite | |
--undo |
Undo previous organization | |
--log-file |
Path to write log file |
File Categories
Files are organized into these categories by default:
- images: jpg, png, gif, svg, webp, ico, etc.
- documents: pdf, docx, txt, xlsx, md, csv, etc.
- scripts: py, js, ts, sh, bat, go, rs, etc.
- archives: zip, tar, gz, rar, 7z, etc.
- videos: mp4, avi, mov, mkv, webm, etc.
- audio: mp3, wav, flac, aac, ogg, etc.
- data: json, xml, yaml, sql, db, etc.
- fonts: ttf, otf, woff, woff2, etc.
- executables: exe, msi, dmg, deb, apk, etc.
- others: unrecognized extensions
Custom Configuration
Create a config.json or config.yaml:
{
"projects": [".sln", ".csproj", ".xcodeproj"],
"ebooks": [".epub", ".mobi", ".azw3"]
}
Use it:
file-organizer-tool /folder --config config.json
Development
# Clone and install
git clone https://github.com/albizzy/file_organizer
cd file_organizer
pip install -e ".[dev]"
# Run tests
pytest tests/ -v
# Run with coverage
pytest tests/ --cov=file_organizer_tool
License
MIT License - see LICENSE for details.
Author
Albert Mwasisoba (@albizzy)
Metadata
Release files for file-organizer-tool 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| file_organizer_tool-2.0.0.tar.gz | 12.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| file_organizer_tool-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.5 kB
Release files / file_organizer_tool-2.0.0.tar.gz
| Download URL | file_organizer_tool-2.0.0.tar.gz |
|---|---|
| Size | 12.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fe8cf0c5d551bcaf2178c134742f0d32e91b67f29ab7a7f9b6ee6cdd539415ee
|
|
BLAKE2b-256 checksum How to use checksums |
60e3caba85d57398f58f7d83fc0a0829fba402610750ed72254121deebba67c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / file_organizer_tool-2.0.0-py3-none-any.whl
| Download URL | file_organizer_tool-2.0.0-py3-none-any.whl |
|---|---|
| Size | 11.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1eacaab157baaeed32c7815fc3a4d1cd47d3a2a26ded0803da3f7b60e2f3128b
|
|
BLAKE2b-256 checksum How to use checksums |
b76d4b3edc346fdb4681c4c9ad063e9d9ea4fa61b7d562daa4fbbad51f979d16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for file-organizer-tool 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.