Skip to main content

A package to copy Gravatar profile pictures to your Google Contacts.

Project description

Gravatar to Google Contacts

This is a Python package to copy Gravatar profile pictures to your Google Contacts.

Description

When run as a script (by running __main__.py) the program will first ask a user to grant the Google Cloud Platform app access to their contacts in their Google Account. It will then download all of their contacts and remove those that don't have an email address and a name.

For each email address in each contact it will attempt to download the corresponding Gravatar photo. If a Gravatar photo is found for that contact then it will update the contact with that photo. If there are multiple possible Gravatar photos (due to a contact having multiple email addresses then a GUI will be presented to choose one. The user is notified which contacts have been updated, and those contacts have the custom Gravatar Photo field set to "True" (so that the program can safely update them in the future).

This program will not update contacts that already have a user-supplied photo that didn't previously come from Gravatar.

Installation & Setup

You can install the absolute latest version using pip install git+https://github.com/cmenon12/gravatar-to-google-contacts.

Dependencies

Note that the versions specified here are what I have been running it on, it may well work on older versions.

  • Python>=3.7.4
  • requests>=2.23.0
  • google_api_python_client>=1.8.3
  • google_auth_oauthlib>=0.4.1
  • libgravatar>=0.2.3
  • Pillow>=7.1.2
  • protobuf>=3.12.1

Creating a new Google Cloud Platform Project and enabling the People API

You will need to create your own Google Cloud Platform Project, enable the People API, and create & download some OAuth 2.0 Client ID credentials as credentials.json.

If you've not used Google Cloud Platform before then you can do all of this really easily by clicking on the large blue button labelled Enable the People API here. Choose to create a Desktop app and as per those instructions in resulting dialog click DOWNLOAD CLIENT CONFIGURATION and save the file credentials.json to your working directory.

Use of the Google People API is (at the time of writing) free.

Creating your own project helps to keep your contacts safe because you control the app that is asking to access them (and you can see my all of my source code here). You can revoke your app from accessing your contacts at https://myaccount.google.com/permissions.

Usage

python -m gravatarcontacts will run the program after installation. Where necessary, the browser window and GUI will open automatically so this program should be run locally (and not over SSH for example).

License

GNU GPLv3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gravatarcontacts-cmenon12-1.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gravatarcontacts_cmenon12-1.0-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file gravatarcontacts-cmenon12-1.0.tar.gz.

File metadata

  • Download URL: gravatarcontacts-cmenon12-1.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.4

File hashes

Hashes for gravatarcontacts-cmenon12-1.0.tar.gz
Algorithm Hash digest
SHA256 8bb032a52be7f739590d78e772114e1ece4a91a7fa5c8446b4e7545939f94789
MD5 3a743f3d768dc339967b1c8f9285da87
BLAKE2b-256 c8d0647b3d1e4df2d083027eb91daa2e3638e19748a2abdbb118f5e1019fe8ae

See more details on using hashes here.

File details

Details for the file gravatarcontacts_cmenon12-1.0-py3-none-any.whl.

File metadata

  • Download URL: gravatarcontacts_cmenon12-1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.4

File hashes

Hashes for gravatarcontacts_cmenon12-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b0e00679c32a3cf0a47dfffc37c652e00303153f461bde66777fa60ef23ef295
MD5 b91aaa7be9638d079cc6912436cfa983
BLAKE2b-256 ce5e1ba0d8f9c645e281bc08ac1823262879980c25002e68c303feead3e4dd35

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page