API Reference¶
This page serves as a complete reference to all public classes and exceptions. This is probably only useful after you have read Quickstart.
petfinder.PetfinderClient¶
-
class
petfinder.PetFinderClient(api_key, api_secret, endpoint='http://api.petfinder.com/')¶ Simple client for the Petfinder API. You’ll want to pull your API details from http://www.petfinder.com/developers/api-key and instantiate this class with said credentials.
Refer to http://www.petfinder.com/developers/api-docs for the required kwargs for each method. It is safe to ignore the
keyargument, as this client handles setting that for you.
breed_list¶
-
PetFinderClient.breed_list(**kwargs)¶ breed.list wrapper. Returns a list of breed name strings.
Return type: list Returns: A list of breed names.
pet_get¶
pet_getrandom¶
pet_find¶
-
PetFinderClient.pet_find(**kwargs)¶ pet.find wrapper. Returns a generator of pet record dicts matching your search criteria.
Return type: generator Returns: A generator of pet record dicts. Raises: petfinder.exceptions.LimitExceededonce you have reached the maximum number of records your credentials allow you to receive.
shelter_find¶
-
PetFinderClient.shelter_find(**kwargs)¶ shelter.find wrapper. Returns a generator of shelter record dicts matching your search criteria.
Return type: generator Returns: A generator of shelter record dicts. Raises: petfinder.exceptions.LimitExceededonce you have reached the maximum number of records your credentials allow you to receive.
shelter_get¶
shelter_getpets¶
-
PetFinderClient.shelter_getpets(**kwargs)¶ shelter.getPets wrapper. Given a shelter ID, retrieve either a list of pet IDs (if
outputis'id'), or a generator of pet record dicts (ifoutputis'full'or'basic').Return type: generator Returns: Either a generator of pet ID strings or pet record dicts, depending on the value of the outputkeyword.Raises: petfinder.exceptions.LimitExceededonce you have reached the maximum number of records your credentials allow you to receive.
petfinder.exceptions¶
Petfinder API exceptions.
-
exception
petfinder.exceptions.AuthenticationFailure¶ Raised when an authentication failure occurs.
-
exception
petfinder.exceptions.GenericInternalError¶ Your guess is as good as mine.
-
exception
petfinder.exceptions.InvalidGeographicalLocationError¶ Raised when an invalid geographical location is specified.
-
exception
petfinder.exceptions.InvalidRequestError¶ Raised when an invalid or mal-formed request is sent.
-
exception
petfinder.exceptions.LimitExceeded¶ Raised when usage limits are exceeded.
-
exception
petfinder.exceptions.PetfinderAPIError¶ Base class for all Petfinder API exceptions. Mostly here to allow end users to catch all Petfinder exceptions.
-
exception
petfinder.exceptions.RecordDoesNotExistError¶ Raised when querying for a record that does not exist.
Raised when attempting to call a method that the user is unauthorized for.
-
exception
petfinder.exceptions.UnrecognizedError¶ This is raised if the API returns a status code that we don’t have a matching exception for. This is more for future-proofing, in case they add extra status codes.