Petpy - Python Wrapper of the Petfinder API¶
Petpy is an unofficial Pythonwrapper of the Petfinder API for interacting with Petfinder’s database of animals and animal welfare organizations.
Getting a Petfinder API and Secret Key¶
An account must first be created with Petfinder to receive an API and secret key. The API and secret key will be used to grant access to the Petfinder API, which lasts for 3600 seconds, or one hour. After the authentication period ends, you must re-authenticate with the Petfinder API.
Installation¶
petpy
is best installed through pip
.
pip install petpy
For those of you who prefer it, the library can also be cloned or downloaded into a location of your choosing and then
installed using the setup.py
script per the following:
git clone git@github.com:aschleg/petpy.git
cd petpy
python setup.py install
Introduction¶
Connecting and using the Petfinder API is as straightforward as initializing the Petfinder()
class. The
following are several examples for extracting data from the Petfinder database and interacting with the Petfinder API.
Authenticating with the Petfinder API¶
Authentication to the Petfinder API occurs when the Petfinder()
class is initialized.
import petpy
pf = Petfinder(key=API_key, secret=API_secret)
Calls to the API to extract data can now be made!
Contents¶
Tutorials and Examples¶
The following are Jupyter Notebooks (launched in Github) that introduce the petpy package and some examples of its usage. The notebooks can also be launched in an interactive environment with binder