A CLI tool that automatically organizes files in a directory by their type. Files are sorted into categorized folders like Images, Documents, Videos, Music, Archives, Code, and more.
- Auto-sort files into folders by extension
- Dry-run mode to preview changes before moving anything
- Watch mode to automatically organize new files as they appear
- Undo the last organization with a single command
- Custom rules via YAML config file
- Rich output with colored terminal logging
- Conflict handling - duplicate filenames get a numeric suffix
git clone https://github.com/qorexdevs/python-file-organizer.git
cd python-file-organizer
pip install -e .Or install dependencies directly:
pip install -r requirements.txtorganizeorganize ~/Downloadsorganize ~/Downloads --dry-runorganize ~/Downloads --verboseorganize ~/Downloads --watchorganize ~/Downloads --undoorganize ~/Downloads --config config.yamlorganize ~/Downloads --dry-run --verbose --config my_rules.yamlUsage: organize [OPTIONS] [PATH]
Organize files in a directory by type.
Options:
-d, --dry-run Preview changes without moving files.
-v, --verbose Show detailed output.
-w, --watch Watch directory and auto-organize new files.
-u, --undo Undo the last organization.
-c, --config PATH Path to YAML config file.
--version Show the version and exit.
--help Show this message and exit.
| Folder | Extensions |
|---|---|
| Images | jpg, jpeg, png, gif, bmp, svg, webp, ico, tiff, ... |
| Documents | pdf, doc, docx, xls, xlsx, ppt, pptx, txt, csv, ... |
| Videos | mp4, avi, mkv, mov, wmv, flv, webm, ... |
| Music | mp3, wav, flac, aac, ogg, wma, m4a, ... |
| Archives | zip, rar, 7z, tar, gz, bz2, xz, ... |
| Code | py, js, ts, java, c, cpp, go, rs, html, css, ... |
| Executables | exe, msi, dmg, app, deb, rpm, apk |
| Fonts | ttf, otf, woff, woff2, eot |
| 3D Models | obj, stl, fbx, blend, 3ds |
Create a config.yaml to add or extend categories. See config.example.yaml for reference:
categories:
Design:
- .psd
- .ai
- .sketch
Ebooks:
- .epub
- .mobiMIT