Skip to main content

A library that provides a Python 3 interface for the Gravatar API.

Project description

https://github.com/pabluk/libgravatar/actions/workflows/python-package.yml/badge.svg

A library that provides a Python 3 interface for the Gravatar API. API details: https://en.gravatar.com/site/implement/

Installation

Install via pip:

$ pip install libgravatar

Usage

See more details on https://libgravatar.readthedocs.org/

Gravatar API

Gravatar API requires no authentication to get images and profiles URLs.

Getting the user profile image:

from libgravatar import Gravatar
g = Gravatar('myemailaddress@example.com')
g.get_image()
'https://www.gravatar.com/avatar/0bc83cb571cd1c50ba6f3e8a78ef1346'

Getting the profile URL:

from libgravatar import Gravatar
g = Gravatar('myemailaddress@example.com')
g.get_profile()
'https://www.gravatar.com/0bc83cb571cd1c50ba6f3e8a78ef1346'

Gravatar XML-RPC API

The XML-RPC API requires authentication.

You can use your Gravatar.com’s email and password:

from libgravatar import GravatarXMLRPC
g = GravatarXMLRPC('name@example.com', password='1234')
g.test() # test the API

or if you have an account at Wordpress.com you can use your email and API key. You can find your API key at https://apikey.wordpress.com/ just be sure to pass to the function your email instead of your username:

from libgravatar import GravatarXMLRPC
g = GravatarXMLRPC('name@example.com', apikey='1234')
g.test() # test the API

Development

To contribute to this project or to test this library locally you’ll need to install these dependencies:

python3 -m venv venv # for example on a virtual environment
source venv/bin/activate
pip install nose black

and you can validate your changes running:

nosetests --with-doctest --verbose
black . --check --diff

Author and contributors

Project details


Download files

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

Files for libgravatar, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size libgravatar-1.0.0-py2.py3-none-any.whl (17.5 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size libgravatar-1.0.0.tar.gz (5.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page