Folder Patrol
One Python script that watches a folder β your Downloads, probably β and files everything into tidy subfolders by type. Windows-first, runs anywhere, zero installs (standard library only).
tested: 10 files sorted, collisions renamed, dry-run inert
Quickstart
- Save the script anywhere. Run
python folder_patrol.pyβ it writespatrol_config.jsonbeside itself and exits. - Open the config, set
"watch_dir"to e.g."C:\\Users\\you\\Downloads". - Run it again. It patrols every 5 seconds until Ctrl+C. Or schedule
python folder_patrol.py --oncein Task Scheduler.
The config file β patrol_config.json
| key | meaning |
|---|---|
watch_dir | the folder to patrol (top-level files only β it never digs into subfolders) |
poll_seconds | how often to scan (min 2) |
dry_run | true = print what would move, move nothing (also --dry-run flag) |
categories | folder name β list of extensions. Edit freely, add your own β "Screenshots": ["png"] wins over Images if listed firstβ¦ actually: last writer wins per extension, so keep each extension in one category. |
other_folder | where unknown extensions go (default Other) |
ignore_names | files to never touch (desktop.ini, Thumbs.dbβ¦) |
Safety β what it will never do
- never deletes and never overwrites β name collisions become
report (1).pdf - refuses to patrol a drive root (no
C:\accidents) - skips files still downloading β size must hold steady across two scans, and
.crdownload/.tmp/.partare ignored - leaves hidden files, its own config, and already-sorted folders alone