A powerful tool to automatically organize your downloads folder
Project description
Downloads Sorter
🗂️ A powerful Python tool to automatically organize your downloads folder.
Features
- 📂 Automatically sorts files into folders based on file type
- 🧠 Intelligently categorizes files based on content patterns
- 📊 Provides statistics about your download organization
- 🔄 Can be set up to run automatically
- 🧹 Clean up your downloads folder with a single command
Installation
pip install downloads-sorter
Usage
Basic Usage
Simply run the command to organize your downloads folder:
downloads-sorter
Options
--dry-run: Show what would be done without actually moving files--stats: Show statistics about your downloads folder organization--directory PATH: Specify a custom downloads directory--verbose: Show detailed logging--setup: Set up automatic sorting with cron (Linux/macOS)--version: Show the version number
Examples
# Sort downloads with a dry run (no actual changes)
downloads-sorter --dry-run
# View organization statistics
downloads-sorter --stats
# Sort files in a custom directory
downloads-sorter --directory /path/to/directory
# Set up automatic hourly sorting
downloads-sorter --setup
Folder Structure
Downloads Sorter organizes files into the following folder structure:
_pdf: PDF documents_docx: Word documents_xlsx: Excel spreadsheets_csv: CSV data files_png,_jpeg,_svg: Images_receipts: Invoices and receipts_contracts: Legal documents and contracts_meetings: Meeting notes and calendar invites_applications: Software installers_projects: Project-related files_misc: Miscellaneous files
Using as a Library
You can also use Downloads Sorter as a Python library in your own scripts:
from downloads_sorter import sort_downloads, get_stats
# Sort downloads
result = sort_downloads()
print(f"Organized {result['moved']} files")
# Get statistics
stats = get_stats()
print(f"Total files: {stats['total_files']}")
print(f"Organized files: {stats['organized_files']}")
Customizing
You can customize the sorting rules by creating your own script using the library:
from downloads_sorter import sort_downloads
from downloads_sorter.sorter import FILE_TYPES, SPECIAL_PATTERNS
# Add custom extensions
FILE_TYPES['.custom'] = '_custom_folder'
# Add custom patterns
SPECIAL_PATTERNS[('mypattern', 'pattern2')] = '_pattern_folder'
# Run with custom rules
sort_downloads()
Contributing
Contributions are welcome! Feel free to open issues or pull requests.
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
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 downloads_sorter-0.2.1.tar.gz.
File metadata
- Download URL: downloads_sorter-0.2.1.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
576ab904eb9f2d7530f861c85d9219f37e4d59a1cd5a460a9b6f82939556e86c
|
|
| MD5 |
f690cb3cc3942631c782ae8099093b5e
|
|
| BLAKE2b-256 |
d2d87ac041c1aa490d58f250c3050bc1289fecad6c241193267fed04319ac2aa
|
File details
Details for the file downloads_sorter-0.2.1-py3-none-any.whl.
File metadata
- Download URL: downloads_sorter-0.2.1-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
266e5c1b23698786236b6647be00dfecb3ec8e3e37d1749940e68eac6177f1c5
|
|
| MD5 |
4819674955749369e14cb45d4ec663b5
|
|
| BLAKE2b-256 |
3e0ae68296b0134a2a7504bb7705bf7c62887d9931cfd83828c8b050634b342e
|