Automatically move video projects that have been exported into a dedicated
Exported/subfolder.
🌍 Language: فارسی
When you finish editing a video project, you usually render/export a final file alongside the raw camera clips. Over time your projects folder fills up with a mix of "done" projects and "still in progress" ones — making it hard to see what still needs work.
sort_exported_projects.py scans every subfolder in your projects directory and checks whether it contains a non-raw video file (i.e. an export). If it does, the entire project folder is moved into an Exported/ subdirectory. Projects that contain only raw camera clips are left untouched.
The script looks for video files (.mp4, .mov, .avi, .mkv, .mts, .m2ts, .wmv, .flv, .webm, .3gp, .mpg, .mpeg) inside each project folder (recursively).
For every video file it finds, it checks the filename stem against this pattern:
one letter + exactly four digits
Examples:
| Filename | Matches raw pattern? | Treated as… |
|---|---|---|
A0012.mp4 |
✅ Yes | Raw camera clip — ignored |
c3132.MTS |
✅ Yes | Raw camera clip — ignored |
final_edit.mp4 |
❌ No | Export → project gets moved |
wedding_color.mov |
❌ No | Export → project gets moved |
If at least one non-raw video is found, the whole project folder is considered "exported".
# Dry-run (default) — preview only, nothing moves
python sort_exported_projects.py
# Dry-run on a specific folder
python sort_exported_projects.py /path/to/projects
# Actually move the folders
python sort_exported_projects.py --live
# Move from a specific folder + see every export file found
python sort_exported_projects.py /path/to/projects --live --verbose###DESKTOP-VERSION
| Flag | Description |
|---|---|
folder |
Root folder to scan (optional — defaults to the script's own directory) |
--dry-run |
Preview mode, no files are moved (default when --live is omitted) |
--live |
Actually move the project folders |
--verbose / -v |
List each export file found inside every project |
Projects/
├── Wedding_2024/ ← has final_edit.mp4 → gets moved
├── Birthday_June/ ← only A0012.MTS → stays
└── Commercial_Nike/ ← has export_v3.mov → gets moved
Projects/
├── Birthday_June/
└── Exported/
├── Wedding_2024/
└── Commercial_Nike/
- Python 3.9+
- No third-party packages — standard library only (
shutil,re,pathlib,argparse)
| Area | Change |
|---|---|
| CLI | --live / --dry-run / --verbose flags via argparse; optional folder argument |
| Detection | Returns the list of export files found, not just a boolean — enables verbose output and accurate counts |
| Safety | Collision handling: if an Exported/ProjectName folder already exists, a numeric suffix is appended instead of overwriting |
| Error handling | PermissionError during scanning is caught and reported without crashing |
| Summary | Final line shows moved / failed / kept counts |
| Raw pattern | Unchanged — [a-zA-Z]\d{4} |
MIT