Skip to main content

Add your description here

Project description

Hacking my Digital Hoarding, one file at a time

This is a personal project I whipped up to keep my fucking download folder organized for once. It is specifically tailored for my Mac setup and isn't intended for widespread distribution as a polished package. I'm sharing the code in a raw, custom way. If it helps you solve a similar problem or inspires your own automation tools, that's great!

🧠 The Problem: The Infinite Downloads Folder Syndrome

I tend to hoard files, installers, and documents with the false promise that "they will be useful in the future." Surprise: they never are. The result is a massive cognitive load that affects both my productivity and my Mac's storage.

This project is born from my own "Mental Framework" to hack digital hoarding:

  1. Identify the trash: Recognizing single-use files (currently focusing on installers like .dmg or .app).
  2. Reduce detachment friction: Instead of deleting them immediately (which triggers that "what if I need it later?" anxiety), I move them to a transition zone.
  3. Automate the habit: I've realized that the cognitive cost and psychological resistance to deleting things are too high for me. I've accepted it. So, I prefer this script to act as my "organized self" and do the job for me automatically.

🚀 The Solution: Version 1.0

This is the first iteration of my cleaning assistant. It uses a Watchdog (filesystem observer) to monitor the downloads folder in real-time and apply my framework rules.

How it works:

  • Auto-Detection: The script watches for any new item arriving in the folder.
  • Smart Filter: It specifically targets .dmg and .app extensions—the main culprits of unnecessary clutter.
  • Move, Don't Delete: Files are moved to a should-be-deleted folder. This hacks the fear of loss, giving me a "grace period" before the final purge.
  • Duplicate Handling: If I download the same installer multiple times, the script detects name collisions and assigns a random number to avoid errors and keep everything traceable.

🛠️ Technologies

  • Python 3.14+
  • uv: An extremely fast Python package installer and resolver.
  • Watchdog: A library to monitor filesystem events. It leverages native OS events to track folder changes in real-time, avoiding the overhead of constant polling.

📦 Installation

1. Clone the repository

git clone <repository-url>
cd download-cleaner

2. Install dependencies using uv

uv sync

3. Configuration

Open main.py and ensure the downloads_folder variable points to your directory:

downloads_folder = Path("~/Downloads").expanduser()

⚙️ Run as a Service (macOS)

You can set this up as a background service using launchd so it runs automatically when you log in.

1. Create the Launch Agent

Create a file named com.user.downloadcleaner.plist in ~/Library/LaunchAgents/:

touch ~/Library/LaunchAgents/com.user.downloadcleaner.plist

2. Configure the Service

Paste the following configuration into the file. Important: Replace YOUR_USERNAME and /PATH/TO/PROJECT with your actual system values.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.user.downloadcleaner</string>

    <key>ProgramArguments</key>
    <array>
        <!-- Path to uv executable -->
        <string>/Users/YOUR_USERNAME/.local/bin/uv</string>
        <string>run</string>
        <!-- Absolute path to main.py -->
        <string>/PATH/TO/PROJECT/download-cleaner/main.py</string>
    </array>

    <key>RunAtLoad</key>
    <true/>

    <key>KeepAlive</key>
    <true/>

    <key>StandardOutPath</key>
    <string>/tmp/com.user.downloadcleaner.stdout.log</string>

    <key>StandardErrorPath</key>
    <string>/tmp/com.user.downloadcleaner.stderr.log</string>

    <key>WorkingDirectory</key>
    <string>/PATH/TO/PROJECT/download-cleaner</string>
</dict>
</plist>

3. Load and Start the Service

launchctl load ~/Library/LaunchAgents/com.user.downloadcleaner.plist

4. Monitoring

Check the logs to see the magic happening:

tail -f /tmp/com.user.downloadcleaner.stdout.log

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

download_sort-0.1.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

download_sort-0.1.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: download_sort-0.1.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for download_sort-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9ef2b32acd91b8377cb7f8d74f04f3e380fb03fa50edb1fbaa4340b502488555
MD5 3093dbd70b867f6725092ca5380713a4
BLAKE2b-256 94deab9d0118c18a2292f4c7fe743f886ba15e1e6188ef8d0c1e72555ad4180e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: download_sort-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for download_sort-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00e76ebbcad527c6b3591a4c9ea66c122b73523311bcca28d080206520dd8b56
MD5 e6fc44826e27bd721c1db12824dabec5
BLAKE2b-256 51bd1ad7bb909611478f99bf4340eb2a6635fbbdf9b68058d70a4a499eb9642c

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