A Python script to automatically organize and clean your Downloads folder by:
- Sorting files into folders based on type (Images, Documents, Videos, etc.)
- Removing
.exefiles (optional cleanup of installers) - Detecting and removing duplicate files by comparing their contents
- Logging every action for transparency
This script scans your ~/Downloads folder and:
- Deletes any
.exefiles to free up space - Sorts files into type-based folders in your home directory:
Images/Documents/Videos/Music/Archives/Others/(for uncategorized files)
- Finds duplicate files (with identical content) and keeps only the latest version
- β Automatically organizes by file type
- ποΈ Deletes
.exefiles safely - π Finds duplicates using full file comparison (
filecmp) - π§ Keeps your newest file version
- π Logs actions with timestamps using Python's
loggingmodule
- Python 3.6 or newer
- Works on macOS, Linux, and Windows
- No external libraries required (uses only the Python standard library)
- Clone this repository:
git clone https://github.com/ApparentlyTejas/ProjectsInPython.git
cd ProjectsInPython
python cleanDownloader.py
π§ Customization
You can change the behavior by editing the script:
File types β Modify the file_type_folders dictionary in main()
Number of duplicates β Currently deletes all but the newest
Safety β You could add a dry-run mode or confirmation prompts
## πββοΈ Author
Tejas Malhotra
Automation enthusiast.
Follow me or contribute at github.com/ApparentlyTejas