Skip to main content

A cool wrapper for Joke API

Project description

About:

joke Is a Python Wrapper that can deliver jokes to you.

Quickstart:

To grab the random 10 jokes, You can use joke.joke.joke.random_10

from joke import joke

result = joke.random_10() #Returns a list of dicts

for item in result: #Irritating through the list, now it returns a dict
    print(item["question"]) #Prints the joke question
    print(item["answer"]) #Prints the joke answer
    print(item["type"]) #Print the type of the joke.

To grab 1 random joke, You can use joke.joke.joke.random

from joke import joke

result = joke.random() #Returns a dict with key value "question", "answer" and "type"

print(result["question"]) #Prints the joke question
print(result["answer"]) #Prints the joke answer
print(result["type"]) #Print the type of the joke

It can also be used in the command line.

>>> unknown@unknown % joke
Question: Why did the man run around his bed?
Answer: Because he was trying to catch up on his sleep!
Type: general

Installing:

pip install -U joke

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

joke-api-1.0.0.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

joke_api-1.0.0-py3-none-any.whl (4.2 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