Skip to main content
PyPI Python Version Wheel Implementation Downloads License

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

Command line

You can exit the function from the command line. There are two entry points:

$ joke
$ python -m joke

With no arguments, it will return a random joke, quote or fact. You can set one specifically API. For example some cat facts:

$ joke cat

Use help to see the possible API’s:

$ joke --help

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 for Linux:

python3 -m venv venv
source venv/bin/activate

Create virtual environment for Windows:

python -m venv venv
.\venv\Scripts\activate

Update dev-tools:

python -m pip install --upgrade wheel pip setuptools twine tox flake8

Install local:

python setup.py develop

Run some tests:

tox
python -m unittest discover
python setup.py test

Publish the packages:

git tag -a 1.0.3 -m '1.0.3'
git push origin 1.0.3
python setup.py --version
python setup.py check
python setup.py sdist bdist_wheel
twine upload dist/*

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.3.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

axju_jokes-1.0.3-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file axju-jokes-1.0.3.tar.gz.

File metadata

  • Download URL: axju-jokes-1.0.3.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.0

File hashes

Hashes for axju-jokes-1.0.3.tar.gz
Algorithm Hash digest
SHA256 3145628ef9e1595ad94a1e1640616e1bbec455d7d646d9e33e0c0f96ad4a7627
MD5 43fc59518f867118b64d38b96f3a42a7
BLAKE2b-256 27482c9bf41e61e7471fcfcbc6451ef045eb132c85d5c7449bdba8b7e1841161

See more details on using hashes here.

File details

Details for the file axju_jokes-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: axju_jokes-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.0

File hashes

Hashes for axju_jokes-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a288fec382ecd2ecf785129438bc1a998342573f472023a2bcfaa6ecf4cbdacc
MD5 e2f82153c187875131d765036cca2c6b
BLAKE2b-256 cc8f53223bbd30685dc85c656e63837c666d0403c1aa33823336f9ad401b66d2

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page