Skip to main content

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.
# Returns a empty list 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.
# Returns a empty list 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.1.tar.gz (2.3 kB view hashes)

Uploaded Source

Built Distribution

dadjokeAPI-1.0.1-py3-none-any.whl (2.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page