TidyFiles is a user-friendly, lightweight CLI tool designed to bring order to your Downloads (or any other) folder! It intelligently organizes files by type and keep logs of all the sorting magic.
Project description
TidyFiles
TidyFiles is a user-friendly, lightweight CLI tool designed to bring order to your Downloads (or any other) folder! It intelligently organizes files by type and keeps logs of all the sorting magic.
๐ Features
- Smart Organization: Automatically categorizes files by type (images, documents, videos, etc.)
- Extensive Format Support & Nested Sorting: Organizes a wide variety of file types into relevant categories and subcategories (e.g.,
documents/ebooks,archives/installers). - Operation History: Track and manage all file operations with detailed history
- View session history with source and destination directories
- Filter history by session ID or limit number of entries
- Detailed operation logs with timestamps and status
- Undo Support: Revert specific operations or entire sessions safely
- Undo individual file moves or directory deletions
- Revert entire sessions with a single command
- Independent operation handling - undo specific files without affecting others
- Operation status tracking (completed, partially_undone, undone)
- Session Management: Track operations by session with detailed status information
- Group operations by session for better organization
- Track session status and completion
- View session details including source/destination paths
- Dry Run Mode: Preview changes with
--dry-runbefore actual organization - Flexible Configuration: Customize source and destination directories
- Detailed Logging: Track all operations with console and file logging
- Rich CLI Interface: Beautiful command-line interface with progress indicators
- Safe Operations: Maintains file integrity during organization
๐ง Tech Stack
-
Core Dependencies
- Python >=3.10: Modern Python features
- Typer: Elegant CLI interface
- Rich: Beautiful terminal formatting
- Loguru: Advanced logging
- Click: CLI framework (Typer dependency)
-
Development Tools
- Ruff: Fast Python linter and formatter
- Pre-commit: Automated code quality checks
- Semantic Release: Automated versioning
-
Testing Framework
- PyTest: Comprehensive test coverage
- Coverage reporting: Detailed test coverage analysis
๐ Getting Started
Installation
pip install tidyfiles
Basic Usage
# Organize files in a specific directory
tidyfiles --source-dir /path/to/your/folder
# Undo last session if something went wrong
tidyfiles undo
Advanced Usage
-
Dry run to preview changes
tidyfiles --source-dir ~/Downloads --dry-run
-
Specify custom destination
tidyfiles --source-dir ~/Downloads --destination-dir ~/Organized
-
Custom logging
tidyfiles --source-dir ~/Downloads --log-console-level DEBUG
-
View operation history (last 10 sessions)
tidyfiles history
-
View more history entries
tidyfiles history --limit 20
-
View detailed session information
tidyfiles history --session 3
-
Undo entire specific session
tidyfiles undo --session 3
-
Undo specific operation in a session
tidyfiles undo --session 3 --number 2
๐ Example Usage
Initial State
Downloads/
โโโ photo1.jpg
โโโ document.pdf
โโโ video.mp4
โโโ photo2.jpg
โโโ archive.zip
After Organization
Downloads/
โโโ images/
โ โโโ photo1.jpg
โ โโโ photo2.jpg
โโโ documents/
โ โโโ document.pdf
โโโ videos/
โ โโโ video.mp4
โโโ archives/
โโโ archive.zip
View History
$ tidyfiles history --limit 3
Operation Sessions
โโโโโโโโโโโโโโณโโโโโโโโโโโโโณโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโณโโโโโโโโโโโโโโ
โ Session ID โ Date โ Time โ Source โ Destination โ Operations โ Status โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ 3 โ 2025-04-04 โ 00:35:48 โ ~/Downloads โ ~/Organized โ 5 โ completed โ
โ 2 โ 2025-04-04 โ 00:34:12 โ ~/Documents โ ~/Organized โ 3 โ completed โ
โ 1 โ 2025-04-04 โ 00:32:05 โ ~/Desktop โ ~/Organized โ 2 โ completed โ
โโโโโโโโโโโโโโดโโโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโดโโโโโโโโโโโโโโ
View detailed session information
$ tidyfiles history --session 3
Session Details
Started: 2025-04-04 00:35:48
Source: ~/Downloads
Destination: ~/Organized
Status: completed
Operations: 5
Session 3 Operations
โโโโโณโโโโโโโโโโโณโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโ
โ # โ Time โ Type โ Source โ Destination โ Status โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ 1 โ 00:35:48 โ move โ ~/Downloads/document.pdf โ ~/Organized/documents/document.pdf โ completed โ
โ 2 โ 00:35:48 โ move โ ~/Downloads/photo1.jpg โ ~/Organized/images/photo1.jpg โ completed โ
โ 3 โ 00:35:48 โ move โ ~/Downloads/photo2.jpg โ ~/Organized/images/photo2.jpg โ completed โ
โ 4 โ 00:35:48 โ move โ ~/Downloads/video.mp4 โ ~/Organized/videos/video.mp4 โ completed โ
โ 5 โ 00:35:48 โ move โ ~/Downloads/archive.zip โ ~/Organized/archives/archive.zip โ completed โ
โโโโโดโโโโโโโโโโโดโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโ
Undo specific session
$ tidyfiles undo --session 3
Do you want to undo all operations in this session? [y/N]: y
โ Successfully undone all operations in session 3
Undo specific operation
$ tidyfiles undo --session 3 --number 2
Do you want to undo operation 2 (~/Downloads/photo1.jpg -> ~/Organized/images/photo1.jpg)? [y/N]: y
โ Successfully undone operation 2 in session 3
๐ Logging and History
TidyFiles maintains comprehensive logs and history:
Console Output
- Real-time operation progress
- Configurable log levels (DEBUG, INFO, WARNING, ERROR)
- Rich formatting with colors and icons
- Operation summaries and confirmations
File Logs
- Detailed operation logs in
~/.tidyfiles/tidyfiles.log - Session history in
~/.tidyfiles/history.json - Persistent across program restarts
- Human-readable format for easy debugging
๐งฐ๏ธ Contributing
We welcome contributions! Check out our Contributing Guidelines.
๐ License
This project is licensed under the MIT License. See the LICENSE file for details.
๐ฏ Future Roadmap (v0.8.0+)
- ๐ Info Feature Expansion: Enhance the info feature to provide detailed metadata and file information.
- ๐ Multi-language Interface: Switch between different languages using
--langflag for global accessibility. - ๐ Custom Categories: Define your own file categories and organization rules via simple configuration.
- ๐ Smart Deduplication: Intelligently detect and handle duplicate files while preserving the newest versions.
- โจ Advanced Renaming: Bulk rename files using patterns, dates, and custom templates.
- ๐ค AI Organization: Use AI to categorize files based on content, not just extensions.
- ๐ฅ๏ธ GUI Interface: Optional graphical interface for users who prefer visual file management.
- โ๏ธ Cloud Integration: Direct organization of Dropbox and Google Drive folders.
- โฐ Scheduled Tasks: Set up automatic organization at specified times or intervals.
- ๐๏ธ Smart Compression: Automatically compress old or large files to save space.
- ๐ Organization Presets: Save and share your favorite organization patterns.
- ๐ Usage Analytics: Track space savings and organization patterns over time.
- ๐ Silent Updates: Seamless background updates with rollback support.
- ๐จ Terminal Themes: Customize CLI appearance with modern color schemes.
- ๐ Smart Notifications: Get notified when long-running operations complete.
- ๐ฑ Remote Control: Monitor and manage operations from your mobile device.
For detailed version history and latest changes, see our CHANGELOG ๐
๐ Stats
- First Release: March 2025
- Latest Version:
- Python Compatibility:
- Platform Support: Windows, macOS, Linux
Created with โค๏ธ by Serhii Ryzhaiev
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 tidyfiles-0.8.0.tar.gz.
File metadata
- Download URL: tidyfiles-0.8.0.tar.gz
- Upload date:
- Size: 92.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad6fba1ee7a4a4374e76442c48f43df0380e6c900a13d847a1f315edbb546bf5
|
|
| MD5 |
6bc5f2aa1c3693791beb3a2a4d923906
|
|
| BLAKE2b-256 |
7881370c5e137aa40d8b792187f7cb5dc9144541200c193f8271dd7f52038466
|
Provenance
The following attestation bundles were made for tidyfiles-0.8.0.tar.gz:
Publisher:
release.yaml on RYZHAIEV-SERHII/TidyFiles
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tidyfiles-0.8.0.tar.gz -
Subject digest:
ad6fba1ee7a4a4374e76442c48f43df0380e6c900a13d847a1f315edbb546bf5 - Sigstore transparency entry: 193074597
- Sigstore integration time:
-
Permalink:
RYZHAIEV-SERHII/TidyFiles@1d051f652d7ad0add4ab10f9cd07e8c4cee455f0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/RYZHAIEV-SERHII
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@1d051f652d7ad0add4ab10f9cd07e8c4cee455f0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tidyfiles-0.8.0-py3-none-any.whl.
File metadata
- Download URL: tidyfiles-0.8.0-py3-none-any.whl
- Upload date:
- Size: 20.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1906748cf05f207be0df58e2d2a76bac3ccba83c24ec08869612833297c538f4
|
|
| MD5 |
6658c6838bd615bc01ff396e24c6fc88
|
|
| BLAKE2b-256 |
9d0103ded186a2bef7c578704b21448871c06695dc158aa06b14fad895626b37
|
Provenance
The following attestation bundles were made for tidyfiles-0.8.0-py3-none-any.whl:
Publisher:
release.yaml on RYZHAIEV-SERHII/TidyFiles
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tidyfiles-0.8.0-py3-none-any.whl -
Subject digest:
1906748cf05f207be0df58e2d2a76bac3ccba83c24ec08869612833297c538f4 - Sigstore transparency entry: 193074599
- Sigstore integration time:
-
Permalink:
RYZHAIEV-SERHII/TidyFiles@1d051f652d7ad0add4ab10f9cd07e8c4cee455f0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/RYZHAIEV-SERHII
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@1d051f652d7ad0add4ab10f9cd07e8c4cee455f0 -
Trigger Event:
push
-
Statement type: