aschleg / petpy

Petpy is an easy-to-use and convenient Python wrapper for the Petfinder API. Includes methods for parsing output JSON into pandas DataFrames for easier data analysis
http://petpy.readthedocs.io
MIT License
28 stars 13 forks source link

Check that the total count of records to return does not exceed 2,000 #7

Closed aschleg closed 6 years ago

aschleg commented 6 years ago

The Petfinder API limits a single call to a maximum of 2,000 records. The only way to return a max 2,000 records is to use the pages parameter in combination with the count parameter. If the multiple of pages and count exceeds 2000, raise ValueError.

aschleg commented 6 years ago

Issue fixed with commit 9741f69. Test added to ensure behavior is consistent with desired functionality.