Open source · MIT · Python

The command line for Apple Photos

osxphotos is a free, open-source tool that gives you complete control over your Apple Photos library — export any photo, query any metadata, and automate the whole thing. It's the engine trusted by thousands to get their memories out, intact.

Install with uvrecommended
uv tool install osxphotos

or pipx install osxphotos

Your library, unlocked

Everything you need to export, query, and automate Apple Photos from the command line.

Export everything

Originals, edited versions, Live Photos, RAW+JPEG pairs, and every associated video — with the folder structure and filenames you choose.

Query by any metadata

Keywords, albums, persons, places, dates, favorites, screenshots, missing files — combine dozens of options to select exactly the photos you want.

Sidecars & metadata

Write EXIF, XMP, and JSON sidecars, embed keywords and captions, and preserve the rich metadata Photos keeps out of reach.

Templating & scripting

A powerful template language and a Python API let you automate exports, build reports, and integrate osxphotos into your own workflows.

Runs on your terms

A fast, scriptable CLI that works on the command line, in cron jobs, or inside your scripts. No cloud, no lock-in.

Free & MIT-licensed

Completely open source and free forever. Trusted by photographers, archivists, and developers to move libraries safely.

A taste of what it does

Export every photo taken in 2024, organized into year/month folders, with sidecar metadata:

osxphotos export ~/Pictures/2024 \
  --from-date 2024-01-01 --to-date 2024-12-31 \
  --directory "{created.year}/{created.month}" \
  --sidecar XMP --download-missing

Free, forever

Star it on GitHub, read the docs, and take back control of your photo library.