The purpose of this project is was to maintain derivative Google Photos albums programmatically. In particular, I want to create a dynamic album of the N most recent photos from one album to populate another.
Why? Dad wants an album of "recent" baby photos (out of the big album where we dump pictures) for his Google Nest Hub and I needed an excuse to play with the Google APIs.
Why not tho? Because Google Photos's API doesn't let you do anything with existing media items and I don't want to reupload media files
By "run" here, I mean: create a configuration file and then do nothing with it.
I'm using Pipenv to manage deps, but do whatever. pipenv install '-e .'
is my jam.
I'm bad about not specifying specific versions of things sorry.
(Instructions adapted from Photos-Upload thanks) ...but there's no point in following them 🤷
- Create and download a
client_secret.json
from Google
- Go to the Google API Console.
- From the menu bar, select a project or create a new project.
- To open the Google API Library, from the Navigation menu, select APIs & Services > Library.
- Search for "Google Photos Library API". Select the correct result and click Enable.
- Under Credentials for your project, create "OAuth Client ID" for Desktop apps and open the newly created credentials link
- Download JSON as
client_secret.json
somewhere useful
$ python3 -m autoalbum.configurator
$ python3 -m autoalbum
$ python3 -m autoalbum autoalbum.behavior.n_most_recent # Use some defaults
$ python3 -m autoalbum autoalbum.behavior.n_most_recent -n 10 # Most explicit
$ python3 -m autoalbum --help # if you want help
- Interactive CLI configurator utility (run this first)
- Dynamic module loading for easy breezy extensibility
- An overengineered architecture for something I could have solved in a single, 100-line script
- Does not actually do anything
- Come back to this when/if the Photos API does what I need it to
- More behaviors?
Suggestions and contributions are always welcome. Please open an issue or submit a PR. Contribution by Google Photos to enable their API is also welcome.