A Python wrapper for the Dog API
Import the module:
import dog_api as dog
Get a list of all the main breeds:
dog.master_breeds()
Get a list of all breeds, including sub-breeds:
dog.all_breeds()
Get a list of the sub-breeds of a particular breed:
# dog.subbreeds({breed})
dog.subbreeds('hound')
Get a random image url:
# from any breed
dog.random_image()
# from a particular breed --> dog.random_image({breed})
dog.random_image('retriever')
# from a particular sub-breed --> dog.random_image({breed}, {sub-breed})
dog.random_image('terrier', 'australian')
Get a list of all the image urls:
# for a particular breed --> dog.all_images({breed})
dog.all_images('poodle')
# for a particular sub-breed --> dog.all_images({breed}, {sub-breed})
dog.all_images('spaniel', 'japanese')
PR's welcome!
Getting started
- Clone or download the repo
- Install the Python dependencies:
pipenv install
- Activate the virtual environment:
pipenv shell
Running tests
py.test
will work ideally, but if not:PYTHONPATH=. py.test
ought to do the trick