A library to fetch dad jokes from a list of 3000 jokes.
Project description
JokeMachine
A Python library to fetch dad jokes from a list of 3000 jokes.
Installation
You can install JokeMachine via pip:
pip install JokeMachine
from JokeMachine import Dad_Joke
# Fetch a random dad joke
setup, punchline = Dad_Joke()
print(setup)
print(punchline)
# Fetch a random dad joke and print the full joke
full_joke = Dad_Joke(full=True)
print(full_joke)
Documentation
Dad_Joke()
Fetches a random dad joke from the API.
Arguments
full(bool, optional): IfTrue, returns the full joke with a newline between setup and punchline.striffullisNone: The full joke as a single string with a newline between setup and punchline.Noneif the request fails or no jokes are available.
Returns
TupleiffullisNone(Default): A tuple representing the random joke fetched from the API, containing the setup (str) and punchline (str).striffullisTrue: The full joke as a single string with a newline between setup and punchline.- None if the request fails or no jokes are available.
Dependencies
requests
Author
Sarah Andersson
- Email Ripsweetener@gmail.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file JokeMachine-0.0.1-py3-none-any.whl.
File metadata
- Download URL: JokeMachine-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18b6fdd6df303e2b5eaf653d9a11142e875f0e086842c29ef560b43a907219ad
|
|
| MD5 |
e4ba82dff58ffe095ff5a593aad09bab
|
|
| BLAKE2b-256 |
e3934a2e7cb0b96637792cbfc873d48563a2a42efdfcc4004253effe6c8bf8bb
|