Skip to main content

Wrapper for the Petfinder API

Project description

# Petpy - Python Wrapper for the Petfinder API

[![Documentation Status](https://readthedocs.org/projects/petpy/badge/?version=latest)](http://petpy.readthedocs.io/en/latest/?badge=latest)
[![Build Status](https://travis-ci.org/aschleg/petpy.svg?branch=master)](https://travis-ci.org/aschleg/petpy)
[![Build status](https://ci.appveyor.com/api/projects/status/xjxufxt7obd84ygr?svg=true)](https://ci.appveyor.com/project/aschleg/petpy)
[![Coverage Status](https://coveralls.io/repos/github/aschleg/petpy/badge.svg?branch=master)](https://coveralls.io/github/aschleg/petpy?branch=master)

Petpy is an easy-to-use and convenient Python wrapper for the [Petfinder API](https://www.petfinder.com/developers/api-docs).

## Example

After receiving an API key from [Petfinder](https://www.petfinder.com/developers/api-key), usage of petpy to extract
data from the Petfinder database is straightforward.

~~~
import petpy

pf = petpy.Petfinder(key)

cats = pf.breed_list('cat')

pf.pet_getRandom()
~~~

The above simple example creates an authenticated connection to the Petfinder API and then uses that connection to
pull the entire list of cat breeds listed in the Petfinder database. The next line returns a randomly selected
pet record.

## Available Methods

Below is a summary table of the available methods in the petpy library and the accompanying Petfinder API method, as
well as a brief description. Please see the petpy documentation for more information on each method. The Petfinder
API methods documentation can also be found [here](https://www.petfinder.com/developers/api-docs#methods).

| Method | Petfinder API Method | Description |
|-----------------------|----------------------|----------------------------------------------------------------------------------------------------|
| breed_list() | breed.list | Returns the available breeds for the selected animal. |
| pet_find() | pet.find | Returns a collection of pet records matching input parameters. |
| pet_get() | pet.get | Returns a single record for a pet. |
| pet_getRandom() | pet.getRandom | Returns a randomly selected pet record. The possible result can be filtered with input parameters. |
| shelter_find() | shelter.find | Returns a collection of shelter records matching input parameters. |
| shelter_get() | shelter.get | Returns a single shelter record. |
| shelter_getPets() | shelter.getPets | Returns a collection of pet records for an individual shelter. |
| shelter_listByBreed() | shelter.listByBreed | Returns a list of shelter IDs listing animals matching the input animal breed. |

## Documentation

* [Petpy documentation](http://petpy.readthedocs.io/en/latest/)
* [Petfinder API documentation](https://www.petfinder.com/developers/api-docs)

## Vignettes

A series of IPython notebooks that introduce and explore the `petpy` library.

* [01 - Introduction](docs/vignettes/01-Introduction.ipynb)

## Installation

Petpy is easily installed through `pip`.

~~~~
pip install petpy
~~~~

## Requirements

Python 2.7 or Python >= 3.3

## License

MIT

Project details


Download files

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

Source Distribution

petpy-1.5.5.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

petpy-1.5.5-py2.py3-none-any.whl (10.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file petpy-1.5.5.tar.gz.

File metadata

  • Download URL: petpy-1.5.5.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for petpy-1.5.5.tar.gz
Algorithm Hash digest
SHA256 9dc16dcb719e0f4ba6e067fe93f097bf15ed5124caa7c27cda56af18aa70a770
MD5 a387292af68eea6d746baecd04d0eb66
BLAKE2b-256 8f6a3afcdb70ac12ea85c243cf1454764d90ab017c1124de8b2b7f0777183283

See more details on using hashes here.

File details

Details for the file petpy-1.5.5-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for petpy-1.5.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ea439317d438326cd9bba6b9616a6cd662cc36df2bf7e35f635930c5794c9947
MD5 4e37c9accd6a7205de656f1cbb459b93
BLAKE2b-256 85431183700491cdee62e9e1b03afb34ff463aab42650128f06f904f36b163e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page