https://github.com/etoews/google-photos-sync-check
Check if your local photos are properly sync'd with your Google Photos
https://github.com/etoews/google-photos-sync-check
google-photos google-photos-api python
Last synced: 6 months ago
JSON representation
Check if your local photos are properly sync'd with your Google Photos
- Host: GitHub
- URL: https://github.com/etoews/google-photos-sync-check
- Owner: etoews
- License: apache-2.0
- Created: 2019-06-08T05:11:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-01-02T00:08:15.000Z (almost 2 years ago)
- Last Synced: 2024-02-14T21:21:05.434Z (over 1 year ago)
- Topics: google-photos, google-photos-api, python
- Language: Python
- Homepage: https://etoews.github.io/google-photos-sync-check/
- Size: 136 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Google Photos Sync Check
[](https://circleci.com/gh/etoews/google-photos-sync-check)
Google Photos Sync Check is a utility to check that the albums you have in [Google Photos](https://photos.google.com/) (GP) are in sync with the albums you have locally on disk.
This utility is part of my personal workflow for how I use GP. GP is my primary storage for all of my photos/videos whereas my home server is my backup storage.
Absolutely all of my photos/videos go into albums. Periodically I download all new albums I've uploaded to GP from my phone and other devices using [Google Takeout](https://photos.google.com/). I use this utility to make sure I haven't missed anything and that it's all in sync. 🔁
* [Google Photos Sync Check](#google-photos-sync-check)
* [Enable the API](#enable-the-api)
* [Authenticate](#authenticate)
* [Run](#run)
* [Test](#test)
* [Notable](#notable)
* [Clean](#clean)## Enable the API
In order to use this utility, follow the instructions in [Enable the Google Photos Library API](https://developers.google.com/photos/library/guides/get-started#enable-the-api).
## Authenticate
Follow the instructions to [Request an OAuth 2.0 client ID](https://developers.google.com/photos/library/guides/get-started#request-id) for the Google Photos API.
When you Create Credentials, choose these options
1. OAuth Client ID
1. Application type: Web application
1. Name: Google Photos Sync Check
1. Authorized redirect URIs: http://localhost:8080/Download the `client_secret_xxxxx.json` file. Name it `client_secret.json` and save it to this dir.
### HttpAccessTokenRefreshError
If you get a `oauth2client.client.HttpAccessTokenRefreshError: invalid_grant: Bad Request` error when executing the script, delete the `client_token.json` file and execute the script again.
## Run
```bash
pipenv install --dev --ignore-pipfile
pipenv shell
python google-photos-sync-check.py --verbose refresh_db
python google-photos-sync-check.py --verbose sync_check ~/Pictures
```## Test
```bash
pipenv shell
python -m pytest --cov=.
```## Notable
Development:
* Git
* VS Code
* Python interpreter
* Docs: [etoews.github.io/google-photos-sync-check/](https://etoews.github.io/google-photos-sync-check/)
* TODO: method and module docsPython:
* Python 3
* Pyenv
* PipenvPython lang features:
* f strings
* list comprehensions
* generators
* argparse
* sets
* context manager
* glob
* lambda
* logging
* signal handler
* TODO: global exception handler
* TODO: types
* ~memoize~Database:
* SQLite
* [SQLiteOnline](https://sqliteonline.com/)
* SQLAlchemy
* indexes
* relationships
* collection_class
* sessionsTesting:
* PyTest
* PyTest-Cov
* PyLint
* CircleCI
* TODO: Memory profileLibrary:
* [Pipfile](Pipfile)
* Google API Python Client
* JinjaWebsites:
* [Google Photos APIs](https://developers.google.com/photos)
* [realpython.com](https://realpython.com/)
* [SQLAlchemy](https://docs.sqlalchemy.org/en/13/orm/tutorial.html)
* [StackOverflow](https://stackoverflow.com)Related work:
* [Timeliner](https://github.com/mholt/timeliner)
* [Perkeep](https://perkeep.org)## Clean
Post Google Takeout cleanup.
```bash
pipenv shell
python scripts/google-takeout-cleanup.py --dry-run ~/Pictures
```