FOLDER_PATROL.PY β€” Setup Wizard

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

  1. Save the script anywhere. Run python folder_patrol.py β€” it writes patrol_config.json beside itself and exits.
  2. Open the config, set "watch_dir" to e.g. "C:\\Users\\you\\Downloads".
  3. Run it again. It patrols every 5 seconds until Ctrl+C. Or schedule python folder_patrol.py --once in Task Scheduler.

The config file β€” patrol_config.json

keymeaning
watch_dirthe folder to patrol (top-level files only β€” it never digs into subfolders)
poll_secondshow often to scan (min 2)
dry_runtrue = print what would move, move nothing (also --dry-run flag)
categoriesfolder 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_folderwhere unknown extensions go (default Other)
ignore_namesfiles 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/.part are ignored
  • leaves hidden files, its own config, and already-sorted folders alone

The script β€” read every line before you run it (always, everywhere)