Skip to main content

One line jokes for programmers (jokes as a service)

Project description

pyjokes

One line jokes for programmers (jokes as a service)

docs/images/pyjokes_logo.png

Installation

Install the pyjokes module with pip:

pip3 install pyjokes

Usage

Command line

Once installed, simply call pyjoke or pyjokes from the command line:

$ pyjoke
Why do Java programmers have to wear glasses? Because they don't see sharp.

Or add it to your .bashrc or .zshrc file to see a joke every time you open a terminal!

See pyjokes --help for more info.

Python

You can also access the jokes in your own project by importing pyjokes and using the function get_joke:

>>> import pyjokes
>>> print(pyjokes.get_joke())
Why do programmers confuse Halloween with Christmas? Because OCT 31 == DEC 25.

We support many languages, and have multiple joke categories:

>>> import pyjokes
>>> print(pyjokes.get_joke("eu"))  # basque joke
Zer dira 8 Bocabits? BocaByte bat
>>> print(pyjokes.get_joke("es", "chuck"))  # spanish chuck norris joke
El teclado de Chuck Norris no tiene tecla F1, es el ordenador el que le pide ayuda a él.

There is also a get_jokes function which returns all the jokes in the given language and category:

import pyjokes

for joke in pyjokes.get_jokes():
    print(joke)

Alternatively, use the pyjokes.forever generator function:

import pyjokes

for joke in pyjokes.forever():
    # This will go on forever... you're welcome.
    print(joke)

Maintainers

The project is maintained by the members of the PyJokes Society:

  • Ben Nuttall
  • Alex Savio
  • Borja Ayerdi
  • Oier Etxaniz (RIP)

Contributing

  • The code is licensed under the BSD Licence
  • Please use GitHub issues to submit bugs and report issues
  • Feel free to contribute to the code
  • Feel free to contribute jokes (via pull request or proposal issue)
  • See the contributing policy

Website and documentation

The pyjokes website and documentation is available at https://pyjok.es/

The story of pyjokes

The story of pyjokes was told by co-founder Ben Nuttall at the PyCon UK conference: https://www.youtube.com/watch?v=nCyquLc47RE

PyJokes logo

The logo was designed by Sam Alder. The PyJokes Society is eternally grateful for his contribution.

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

pyjokes-0.8.1.tar.gz (44.6 kB view details)

Uploaded Source

Built Distribution

pyjokes-0.8.1-py3-none-any.whl (47.6 kB view details)

Uploaded Python 3

File details

Details for the file pyjokes-0.8.1.tar.gz.

File metadata

  • Download URL: pyjokes-0.8.1.tar.gz
  • Upload date:
  • Size: 44.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for pyjokes-0.8.1.tar.gz
Algorithm Hash digest
SHA256 890049e7d11d3a25d7586b8c82c177c9fb918005f1c2d843311a168f7bd06fcc
MD5 33f91553079acfbebc300e07093832ae
BLAKE2b-256 54805aeb4395394cba1c634dca2789b008d91790baba8fb36b54621212cee30f

See more details on using hashes here.

File details

Details for the file pyjokes-0.8.1-py3-none-any.whl.

File metadata

  • Download URL: pyjokes-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 47.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for pyjokes-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e72caa791d411771d871c3b08338ba8afc82103eaa76fb3e8afe60619d52dd1e
MD5 abd746a4c4b2e7338fd7cbb272932a91
BLAKE2b-256 c7b97ca6d601bbfc74fa8e2eb31f42e45ceb94682af881f2f415265a235e0ab5

See more details on using hashes here.

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