What does HackerNews think of osxphotos?

Python app to export pictures and associated metadata from Apple Photos on macOS. Also includes a package to provide programmatic access to the Photos library, pictures, and metadata.

Language: Python

#60 in macOS
#2 in macOS
#124 in Python
Nice to hear from someone else with a huge iCloud Photo Library--we've got about 1.2 TB! After a lot of experimentation with Google Photos, Synology's photo APP, etc. we finally settled on going all in on the Apple ecosystem (we're an all-Apple family). The game-changer for us was when Apple finally supported shared photo libraries between users.

The ability to search the photo library has been steadily improving (in my experience, Google still has an edge over Apple in this area) and with the advent of new AI technology I only expect it to get better. Except for special occasions I don't even attempt to "organize" or "tag" my photos. It reminds me of how Google Search surpassed early 'library catalog' style indexes like Yahoo.

The biggest downside of iCloud is the lack of an API to access the data programmatically for backups etc. I've experimented with `icloudpd` and it worked OK, but I'm not sure about the long-term stability as it's basically just "screen scraping" iCloud.com to download the photos from the web which is not officially supported by Apple and is sensitive to any changes to the website as well as the (remote?) possibility of getting your account banned. The performance is also bad as it has to download all photos even the ones that are already stored locally.

There’s also `osxphotos` (https://github.com/RhetTbull/osxphotos) which works by reverse engineering the undocumented sqlite database in the photos library that Apple uses for storing the photos metadata. This avoids the performance problems of accessing the library through iCloud.com like `icloudp` does and enables many more features like searching by faces, places, etc. and they have an export function with a ton of options to backup your library.

Finally, I have a side-project working on a simple set-it-and-forget Mac app for backing up your entire photo library (including iCloud Photos) to a local disk, network share, NAS, etc. Unlike the above options, it uses the official Apple PhotoKit library to access the photos and doesn’t require setting up a Python environment, running command-line tools, etc. If you’re interested check it out here: https://www.ibeni.net

I'm the author of the osxphotos[0] tool mentioned in the article. For photos in an Apple Photos library, osxphotos gives you access to a rich set of metadata beyond what's in the actual EXIF/IPTC/XMP of the image. Apple performs object classification and other AI techniques on your images but generally doesn't expose this to the user. For example, photos are categorized as to object in them (dog, cat, breed of dog, etc.), rich reverse geolocation info (neighborhood, landmarks, etc.) and an interesting set of scores such as "overall aesthetic", "pleasant camera tilt", "harmonious colors", etc. These can be queried using osxphotos, either from the command line, or in your own python code. (Ref API docs[1])

For example, to find your "best" photos based on overall aesthetic score and add them to the album "Best Photos" you could run:

osxphotos query --query-eval "photo.score.overall > 0.8" --add-to-album "Best Photos"

To find good photos with trees in them you could try something like:

osxphotos query --query-eval "photo.score.overall > 0.5" --label Tree --add-to-album "Good Tree Photos"

There's quite a bit of other interesting data in Photos that you can explore with osxphotos. Run `osxphotos inspect` and it will show you all the metadata for whichever photo is currently selected in the Photos app.

[0] https://github.com/RhetTbull/osxphotos [1] https://rhettbull.github.io/osxphotos/

I’ve been using this tool to backup Apple Photos library to an external drive: https://github.com/RhetTbull/osxphotos
I also self-host this together with Tailscale. The UI is not very polished but certainly very usable already.

My personal journey was to get rid of my dependency on iCloud Photos. I managed to export two-decades worth of pictures and videos using a separate tool (https://github.com/RhetTbull/osxphotos) and then import into PhotoPrism. Coming from Apple Photos, the UI is a bit lackluster but the freedom of owning the entire data more than makes up for it.

https://github.com/RhetTbull/osxphotos

A macOS command-line "multi-tool" for working with Apple Photos. Allows you to export photos (along with all the metadata), batch-edit metadata such as times and timezones, explore the AI metadata Apple computes for each photo (but doesn't make available to the user) such as "well timed shot", "pleasant composition", etc, compare libraries, sync metadata between libraries, and much more! It's written in python and provides a full python API for interacting with Photos.

In a similar vein, I am doing a migration from iCloud Photo Library from a completely self-hosted cloudless solution. Getting the photos out is easy enough, but there's no easy UI to export the albums and smart albums and tags etc. Was doing quite a bit of AppleScript programming before I discovered https://github.com/RhetTbull/osxphotos