gravify¶
gravify is a simple package to generate Gravatar URLs. 🔗
>>> user = Gravatar("example@example.com")
>>> user.url
'https://www.gravatar.com/avatar/23463b99b62a72f26ed677cc556c44e8'
Installation¶
gravify is available on PyPI:
$ python -m pip install gravify
gravify officially supports Python 2.7 & 3.5+.
API Reference¶
Simple package to generate Gravatar URLs
- class gravify.Gravatar(email, verify_email=True, default_image=None, size=None, force_default=False, max_rating=None)[source]¶
A class to represent a Gravatar user
- Parameters
email (str) – The user’s email address
verify_email (bool) – Whether to verify that the email address is valid
default_image (str) – The default image code to use if the user isn’t found (one of: 404, mp, identicon, monsterid, wavatar, retro, robohash, blank)
size (int) – A single dimension determining the size of the image (between 1 and 2048)
force_default (bool) – Whether to always force the default image
max_rating (str) – The maximum rating to be shown (one of: g, pg, r, x)
- Raises
ValueError – The email address is invalid
- property file¶
The contents of the generated Gravatar URL
- Returns
str
- property hash¶
The MD5-hashed email address
- Returns
str
- property unsecure_url¶
The generated unsecure (http) Gravatar URL
- Returns
str
- property url¶
The generated secure (https) Gravatar URL
- Returns
str