Jokes for python
Project description
Jokes for python.
I was really sad, no package called joke. So I decided to create one, really fast. This package have some functions, that return some jokes, quotes or facts. If you are sad, use the joke packages. :)
Install
pip install axju-jokes
Examples
Some jokes examples
from joke.jokes import *
# This will import all joke-functions (geek, icanhazdad, chucknorris, icndb)
# Now you can use them to get some jokes.
# For example you can display 10 Chuck Norris jokes.
for i in range(10):
print(chucknorris())
# Or get a random joke-function.
from random import choice
print(choice([geek, icanhazdad, chucknorris, icndb])())
Some quotes examples
from joke.quotes import *
# get a quote from quotesondesign.com
print(quotesondesign())
# you can get more then one with one request
for quote in quotesondesign(5):
print(quote)
# and you can get the data
data = quotesondesign(format='data')
print(data['quote'])
print(data['author'])
# get quote from stormconsultancy.co.uk
print(stormconsultancy())
# You can set the ID to get a specific quote
print(stormconsultancy(id=2))
# the stormconsultancy-function give you also the data
data =stormconsultancy(id=2, format='data')
print(data['quote'])
print(data['author'])
Check also the example folder.
Import Easter Egg
>>> import joke.eggs Chuck Norris has to register every part of his body as a separate lethal weapon. His spleen is considered a concealed weapon in over 50 states.
API’s
To get the jokes, I use some open API’s. If you know some missing API’s, please contact me. Until now, the following API’s are used.
Development
Clone repo:
git clone https://github.com/axju/joke.git
Create virtual environment and update dev-tools:
python3 -m venv venv source venv/bin/activate pip install --upgrade wheel pip setuptools twine tox
Install local:
pip install -e .
Run some tests:
tox python -m unittest discover python setup.py test
Publish the packages:
python setup.py sdist bdist_wheel twine upload dist/*
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 Distribution
axju-jokes-1.0.0.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for axju_jokes-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd92fd39d56e14f5c9d5f2f80ad8c585cf1991d0c3aaac9c5717f8159b8c4c75 |
|
MD5 | 029062a0d73ef84bbeeb746ac6ed9f7c |
|
BLAKE2b-256 | b622251b33738c2e8f958e8c1b04e9eb7ec6832c275f5c86a422a1781e1b3306 |