A simple API wrapper for your dad joke needs.
Project description
dadjokeAPI - A simple API for your dad joke needs.
Non-asynchronous usage:
from dadjokeAPI import searchDadJokes
from dadjokeAPI import getDadJoke
# Prints a dad joke with a random or specified ID.
# Raises JokeNotFoundException if the joke was not found.
print(getDadJoke("0189hNRf2g"))
# Prints a list of dad jokes with a random or provided term.
# Raises JokeNotFoundException if no jokes were found.
print(searchDadJokes("fish"))
Asynchronous usage:
from dadjokeAPI import searchDadJokesAsync
from dadjokeAPI import getDadJokeAsync
# Prints a dad joke with a random or specified ID.
# Raises JokeNotFoundException if the joke was not found.
# Has an optional aiohttp.ClientSession argument called http
# in case you want to provide your session.
print(await getDadJokeAsync("0189hNRf2g"))
# Prints a list of dad jokes with a random or provided term.
# Raises JokeNotFoundException if no jokes were found.
# Has an optional aiohttp.ClientSession argument called http
# in case you want to provide your session.
print(await searchDadJokesAsync("fish"))
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
dadjokeAPI-1.0.0.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for dadjokeAPI-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3ee2690e2eb1392e5d6e9929b000ebdb2b86bd35930e56b65ea053660e032a1 |
|
MD5 | 0001b6d768a69e40d0f637775673f8c4 |
|
BLAKE2b-256 | ff94e174c45d57833d633ed8362486ef793648295972b819b67bb84c9fdbd486 |