Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pabluk/libgravatar
A library that provides a Python 3 interface for the Gravatar APIs
https://github.com/pabluk/libgravatar
gravatar python python3
Last synced: about 7 hours ago
JSON representation
A library that provides a Python 3 interface for the Gravatar APIs
- Host: GitHub
- URL: https://github.com/pabluk/libgravatar
- Owner: pabluk
- License: gpl-3.0
- Created: 2010-01-07T19:06:43.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2024-01-16T20:49:08.000Z (10 months ago)
- Last Synced: 2024-04-25T16:22:05.936Z (6 months ago)
- Topics: gravatar, python, python3
- Language: Python
- Homepage: https://libgravatar.readthedocs.org/
- Size: 96.7 KB
- Stars: 41
- Watchers: 4
- Forks: 16
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
===========
libgravatar
===========.. image:: https://github.com/pabluk/libgravatar/actions/workflows/python-package.yml/badge.svg
:target: https://github.com/pabluk/libgravatar/actions/workflows/python-package.ymlA 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:
.. code-block:: python
from libgravatar import Gravatar
g = Gravatar('[email protected]')
g.get_image()
'https://www.gravatar.com/avatar/0bc83cb571cd1c50ba6f3e8a78ef1346'Getting the profile URL:
.. code-block:: python
from libgravatar import Gravatar
g = Gravatar('[email protected]')
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:
.. code-block:: python
from libgravatar import GravatarXMLRPC
g = GravatarXMLRPC('[email protected]', password='1234')
g.test() # test the APIor 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:.. code-block:: python
from libgravatar import GravatarXMLRPC
g = GravatarXMLRPC('[email protected]', apikey='1234')
g.test() # test the APIDevelopment
-----------To contribute to this project or to test this library locally you'll need to install these dependencies:
.. code-block:: shell
python3 -m venv venv # for example on a virtual environment
source venv/bin/activate
pip install pytest blackand you can validate your changes running:
.. code-block:: shell
pytest --doctest-modules --verbose
black . --check --diffAuthor and contributors
-----------------------* Pablo Seminario (`@pabluk `_)
* Caleb FANGMEIER (`@cfangmeier `_)
* Rarm NAGALINGAM (`@snowjet `_)
* Manan (`@mentix02 `_)
* Gareth Simpson (`@xurble `_)
* Sean Kelly (`@nutjob4life `_)