Registry / http-networking / libgravatar

libgravatar

JSON →
library1.0.4pypypi✓ verified 84d ago

A Python 3 library providing an interface to the Gravatar API. Version 1.0.4 (latest) includes support for FIPS-enabled systems and drops Python 3.6. Release cadence is low (major versions years apart).

pip install libgravatar
INSTALL
IMPORT
SIG · LIBGRAVATAR
L
libgravatar
http-networkingpythonv1.0.4
Install
1.5s avg
Import
74ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.076s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.072s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Gravatar
from libgravatar import Gravatar
Main class for Gravatar API access.

Create a Gravatar instance with an email and retrieve the avatar image URL. Note: use_ssl defaults to True since v1.0.0.

from libgravatar import Gravatar g = Gravatar('user@example.com') print(g.get_image()) # URL of avatar
Debug
Known issues
breakingIn version 1.0.0, the default for use_ssl changed from False to True. All URLs now use HTTPS by default. If your code relied on HTTP, update accordingly.
fix
Explicitly set use_ssl=False if you need HTTP: Gravatar(email, use_ssl=False)
affects: <1.0.0
deprecatedPython 3.6 support was removed in version 1.0.4. If you are on Python 3.6, you must stay on an older version or upgrade Python.
fix
Upgrade to Python 3.7+ or pin libgravatar to 1.0.3.
affects: >=1.0.4
gotchaThe get_image() method returns a URL string, not the image binary. To download the image, you need an HTTP request.
fix
Use requests.get(g.get_image()) to get the actual image data.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'libgravatar'
Library not installed or installed under a different name (e.g., gravatar).
fix
Run: pip install libgravatar
AttributeError: 'Gravatar' object has no attribute 'get_image'
The method may have been renamed or not exist in older versions. The correct method is get_image().
fix
Use g.get_image() (no underscore separation).
libgravatar.GravatarError: invalid email address
The email provided fails basic validation (e.g., missing @).
fix
Check the email string for typos. Ensure it contains '@' and a valid domain.
Upgrade
Version history
1.0.4latest on PyPI · released Mar 6, 2023
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
libgravatar — pip install libgravatar · libregistry