~/Photos/
2005/
01_January/
02_February/
…
2006/
…
rename_photos.py
Renames photos in a folder to a consistent YYYY-MM-DD_HHMMSS_originalname.ext format. Uses EXIF DateTimeOriginal when available, falls back to file modification time.
python rename_photos.py ~/Photos/unsorted
sort_photos_into_dirs.py
Moves (or copies) photos from a flat folder into a Year/Month directory tree automatically.
python sort_photos_into_dirs.py ~/Downloads/OldPhotos ~/Photos –copy
Requirements
pip install Pillow
Pillow is used to read EXIF data for accurate photo dates. If not installed, all scripts fall back to file modification time.
Typical Workflow
Run create_photo_dirs.sh to build the folder structure.
Run rename_photos.py on your unsorted folder to standardize filenames.
Run sort_photos_into_dirs.py to move everything into the right Year/Month folder.