Skip to main content

Automation tool that cleans up Downloads folder and places items in appropriate locations

Project description

CDHL

CDHL (Clean Drive Happy Life) is a Python utility that automatically organizes files in your Downloads folder by file type, with a dry-run preview before making any changes.

Features

  • Dry Run Preview - See what changes will be made before actually moving files
  • Proper Categorization - Automatically sorts files into appropriate folders:
    • Images (~/Pictures)
    • Audio (~/Music)
    • Videos (~Videos)
    • Documents (~/Documents)
    • Applications (~/Applications)
    • Archives (~/Archive)
    • Miscellaneous (~/Miscellaneous)
    • Other (~/Other)
  • Efficient Processing - Uses generators for memory-efficient handling of large directories
  • Safe Operation - Requires user confirmation before moving files
  • Comprehensive File Type Support - Recognizes 100+ file extensions across all major categories

Installation

pip install CDHL

Usage

from cleaner import chdl

# Run the file organizer
chdl()

The tool will:

  1. Scan your Downloads folder
  2. Show a preview of where each file will be moved
  3. Ask for confirmation
  4. Move files to their appropriate destinations

Supported File Types

  • Images: jpg, jpeg, png, gif, webp, bmp, svg, tiff, heic, raw, and more
  • Audio: mp3, wav, flac, aac, ogg, opus, and more
  • Videos: mp4, mov, avi, mkv, webm, mpeg, and more
  • Documents: pdf, doc, docx, txt, xlsx, ppt, csv, epub, and more
  • Applications: exe, msi, app, dmg, apk, jar, and more
  • Archives: zip, rar, 7z, tar, gz, iso, and more

Example Output

example_photo.jpg will be moved to /Users/username/Pictures
song.mp3 will be moved to /Users/username/Music
video.mp4 will be moved to /Users/username/Videos
document.pdf will be moved to /Users/username/Documents

Begin sorting? y/n:

Requirements

  • Python 3.9+
  • No external dependencies (uses only standard library)

Safety Features

  • All operations show a preview before execution
  • User must explicitly confirm file movements
  • Graceful error handling for missing files, permission issues, and OS errors
  • Creates destination folders automatically if they don't exist

Development

This project uses Hatchling as the build backend.

Building

python -m build

Future Enhancements

  • Recursive folder scanning
  • Custom categorization rules
  • Configuration file support
  • Undo functionality
  • Duplicate file handling

License

MIT License

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Author

Mon G.

Changelog

0.1.0 (Initial Release)

  • Basic file organization by type
  • Dry run preview functionality
  • User confirmation before file movement
  • Support for 100+ file extensions

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

cdhl-0.1.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

cdhl-0.1.1-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file cdhl-0.1.1.tar.gz.

File metadata

  • Download URL: cdhl-0.1.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for cdhl-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e2dbb65f32db8ae1494ad19f04cda7ef6da994ea82523387380a020f43e1b12f
MD5 f0678371a89040c6a9a54e81994746e7
BLAKE2b-256 857942bca92d852cb86ef9ed098fdbe6f127a48fe84daa18be14d64250db6831

See more details on using hashes here.

File details

Details for the file cdhl-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cdhl-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for cdhl-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 62288f67cbe0bc7dba4f878bcdc12b85c39c15b29ae50604639468c38975b1c8
MD5 d4c0ebf326851e8c5032a0cd18a1437a
BLAKE2b-256 8679122b317e73a9828a57238db3f0f41a156bd11ee492878cecba2142478e2a

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