Skip to content

erpycode/sort-exported-projects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

sort_exported_projects

Automatically move video projects that have been exported into a dedicated Exported/ subfolder.


🌍 Language: فارسی


🇬🇧 English

What does it do?

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.

How does it decide what is "exported"?

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".

Usage

# 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

in this version just put py file in your folder and Double-Click it. it will work

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

Before / After

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/

Requirements

  • Python 3.9+
  • No third-party packages — standard library only (shutil, re, pathlib, argparse)

What changed in v2

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}

License

MIT

About

Automatically organize exported video projects into an Exported folder.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages