Skip to main content

Gravatar to Google Contacts

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

GitHub issues GitHub license

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 it using pip install gravatarcontacts-cmenon12.

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
  • 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.11.0

Creating a 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 the instructions there in the resulting dialog click DOWNLOAD CLIENT CONFIGURATION and save the file credentials.json to where you're working. You mustn't share credentials.json or token.pickle with anyone.

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 stop your app accessing your contacts by revoking it 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

Metadata

Release files for gravatarcontacts-cmenon12 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gravatarcontacts-cmenon12 1.0.5
File Size Uploaded
gravatarcontacts-cmenon12-1.0.5.tar.gz 8.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gravatarcontacts-cmenon12 1.0.5
File Interpreter ABI Platform
gravatarcontacts_cmenon12-1.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 30.5 kB

Release files / gravatarcontacts-cmenon12-1.0.5.tar.gz

Download URL gravatarcontacts-cmenon12-1.0.5.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0954f575f1eb8eb6684ea106a2d108516e1b57db2d21292ccf42c1e2665a3cc9
BLAKE2b-256 checksum
How to use checksums
9722e46c56473d18481f1eb8c34fad811dbc9b6b53337ccb85efb89b3eda572b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

Release files / gravatarcontacts_cmenon12-1.0.5-py3-none-any.whl

Download URL gravatarcontacts_cmenon12-1.0.5-py3-none-any.whl
Size 22.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9f1e61aa896b2e9dde218e21d093048870a0db755ad912800c6ffcff4fd4b220
BLAKE2b-256 checksum
How to use checksums
b1578e85d6ac055adb260fca074001436c166e37aa7f4152de92ea277138990d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

Release history Release notifications | RSS feed

This release

1.0.5 This release

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page