Skip to content
wckd14Public

About

Smart photo and video organizer that automatically sorts media by creation date using EXIF metadata

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

📸 PhotoSort — Smart Photo & Video Organizer

Organize your memories chronologically — with precision and zero guesswork.

PhotoSort is a modern, Python-based photo and video organizer that automatically sorts your media by true creation date, using intelligent metadata detection and filesystem timestamps.

Perfect for casual photographers, content creators, and anyone drowning in thousands of unsorted photos from phones, cameras, or backup drives.


🤔 Why PhotoSort?

For Everyone:

  • 📱 Tired of scrolling endlessly through years of unsorted photos on your phone or computer?
  • 🗂️ Want automatic organization without manually sorting thousands of files?
  • 🔍 Can't find that vacation photo from 2019 because everything's in one giant folder?
  • 📦 Merging photos from multiple devices, cloud backups, or old hard drives?

PhotoSort solves this. Point it at your messy photo library, and it automatically organizes everything into clean year/month folders based on when each photo was actually taken.

For Technical Users:

PhotoSort uses a weighted EXIF metadata model to extract the most reliable creation timestamp from each file. It intelligently prioritizes DateTimeOriginal over filesystem timestamps, handles timezone conversions, prevents duplicates, and works seamlessly across different operating systems and storage devices.


🚀 Features

🧠 Metadata-based date detection — extracts and weights multiple EXIF fields
⚖️ Weighted reliability model — picks the most trustworthy creation date automatically
🗂️ Automatic folder hierarchy — organizes media into YEAR/MONTH/filename
🪶 Duplicate-safe renaming — never overwrites files
🔄 Cross-filesystem move — works seamlessly across disks and OSes
🧾 Progress bar + verbose logging
🧱 Dry-run mode — preview everything before moving files
🚫 Exclude folders — skip unwanted subdirectories
🪪 Preserves file timestamps & metadata
🧍‍♂️ Works on macOS, Linux, and Windows

🔰 New to photo organizing?
Don't worry about the technical terms above — PhotoSort handles all the complexity automatically. Just point it at your messy photo folder and let it work its magic!


🧰 Requirements

  • Python ≥ 3.8
  • ExifTool (for reading photo metadata)

Installing ExifTool:

macOS:

brew install exiftool

Ubuntu/Debian:

sudo apt-get install libimage-exiftool-perl

Windows:

  1. Download ExifTool
  2. Extract the .exe file
  3. Add it to your system PATH

⚙️ Installation

PhotoSort uses uv — a fast, modern Python package manager that creates isolated environments automatically. Think of it like a clean workspace just for PhotoSort.

Step 1: Install uv

macOS/Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

Windows (PowerShell):

powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

Step 2: Download PhotoSort

git clone https://github.com/yourusername/PhotoSort.git
cd PhotoSort

Step 3: Create an Isolated Environment

uv venv

This creates a .venv folder with a clean Python environment.

Step 4: Activate the Environment

macOS/Linux:

source .venv/bin/activate

Windows:

.venv\Scripts\activate

You'll see (.venv) appear in your terminal prompt — this means you're inside the PhotoSort environment.

Step 5: Install Dependencies

uv pip install tqdm python-dateutil

Step 6: Make the Script Executable (Optional - macOS/Linux only)

chmod +x photosort.py

🧭 Usage Examples

🟢 Basic Run — Organize Media by Date

uv run photosort.py \
  --source "/Users/alex/CameraUploads" \
  --destination "/Users/alex/OrganizedMedia"

What happens:

  1. PhotoSort scans all photos/videos in the source folder
  2. Extracts creation dates from EXIF metadata
  3. Sorts files into folders like 2023/09/IMG_1234.JPG
  4. Moves them to your destination directory

🟡 Dry Run (Safe Preview)

uv run photosort.py \
  --source /mnt/photos \
  --destination /mnt/organized \
  --dry-run --verbose

Perfect for first-time use! No files are moved — just a detailed simulation showing exactly what would happen.

🔴 Exclude Unwanted Folders

uv run photosort.py \
  --source /mnt/archive \
  --destination /mnt/sorted \
  --exclude "cache" "exports" "screenshots"

Skips any folder whose path contains one of those names.


📁 Example Output

Before (messy):

CameraUploads/
├── IMG_0012.JPG (taken in 2018)
├── vacation_day1.jpg (taken in 2020)
├── wedding_01.HEIC (taken in 2019)
├── ChristmasParty.MOV (taken in 2018)
└── ... 5,000 more unsorted files

After (organized):

OrganizedMedia/
├── 2018/
│   ├── 01/
│   │   ├── IMG_0012.JPG
│   │   └── ChristmasParty.MOV
│   └── 12/
│       └── ...
├── 2019/
│   └── 05/
│       ├── wedding_01.HEIC
│       └── wedding_02.MP4
└── 2020/
    └── 07/
        └── vacation_day1.jpg

🧠 How It Works (Technical Details)

PhotoSort uses a weighted EXIF field model to choose the most reliable creation date:

Metadata Field Weight Purpose
DateTimeOriginal 1.0 Primary creation date
CreateDate 0.9 Secondary EXIF timestamp
ModifyDate 0.6 Last modification date
FileCreateDate 0.4 Filesystem creation time
filesystem_mtime 0.3 Filesystem modification time

If EXIF metadata is missing, it falls back to the filesystem timestamp — or current time as a last resort.


🧩 Supported File Types

.jpg  .jpeg  .png  .heic
.mp4  .mov   .avi  .mkv

You can extend support easily by editing EXTENSIONS in the script.


🧾 Command Reference

Option Description
--source Source directory containing photos/videos
--destination Target directory for organized files
--dry-run Simulate without moving files
--verbose Print detailed logs
--exclude List of subfolders to skip

🧱 License

MIT License — free to use, modify, and distribute.
See LICENSE for full text.


❤️ Contributing

Pull requests, issues, and ideas are welcome!

If you add new metadata fields, file types, or features (e.g. duplicate detection, cloud sync), open a PR and help improve PhotoSort for everyone.


🔍 Keywords

photo organizer, video organizer, metadata-based sorting, python exiftool, photo library manager, digital asset organizer, photo sorter, uv python, astral uv, date-based media organizer, open source photo tool, exif date sorter, camera roll organizer


🌟 Support

If PhotoSort saved you hours of manual sorting, consider:

  • ⭐ Starring the repo on GitHub
  • 🐛 Reporting bugs or suggesting features
  • 📢 Sharing with fellow photographers

Made with ❤️ for photographers who value their memories.

About

Smart photo and video organizer that automatically sorts media by creation date using EXIF metadata

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages