Skip to main content

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

downloads_sorter-0.1.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

downloads_sorter-0.1.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file downloads_sorter-0.1.0.tar.gz.

File metadata

  • Download URL: downloads_sorter-0.1.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for downloads_sorter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 680a029f3d021fbf1cb8c2f90513b44bce10581f3793ebb51d16f5aa8cc1dc7c
MD5 968c4fb76a8b209f5aa9c06b37fac27f
BLAKE2b-256 3cf179ffff6f5fc69cc8514623cdb31f33e9b6e103a6e7fdb0841a1b3f8a94ec

See more details on using hashes here.

File details

Details for the file downloads_sorter-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for downloads_sorter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f1647bd4e2dfd24af754c8f7e850e978033ae24fb29357622c70d4b616b3e0e8
MD5 0307d6c637991e14126daf0b0b3aafc3
BLAKE2b-256 74f0d81817669d65f41f9a3697d20486c0c53313a8face4de01c3c57fe960e3b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page