Last active
May 3, 2018 11:55
-
-
Save 4Kaylum/1b49e030545f6d8aaa9cd4e306003fd8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from requests import get | |
| def get_dog(*, dog_id:str='', limit:int=1) -> dict: | |
| url = 'https://api.thedogapi.co.uk/v2/dog.php' | |
| params = {} | |
| if dog_id: | |
| params.update({'id': dog_id}) | |
| if limit > 1: | |
| params.update({'limit': limit}) | |
| site = get(url, params=params) | |
| return site.json() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment