Skip to main content

pyjokes

One line jokes for programmers (jokes as a service)

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.

Metadata

Release files for pyjokes 0.8.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyjokes 0.8.3
File Size Uploaded
pyjokes-0.8.3.tar.gz 44.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyjokes 0.8.3
File Interpreter ABI Platform
pyjokes-0.8.3-py3-none-any.whl Python 3 none any Details

Total release size: 92.2 kB

Release files / pyjokes-0.8.3.tar.gz

Download URL pyjokes-0.8.3.tar.gz
Size 44.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5735d31e973d5b6934b46b89431505733c3110f9b66eac0ff0be86f7f3646423
BLAKE2b-256 checksum
How to use checksums
30cc2d25e5397d7a6d362971f23b42c8b624c5298c0864a1000cd587f39e6748
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release files / pyjokes-0.8.3-py3-none-any.whl

Download URL pyjokes-0.8.3-py3-none-any.whl
Size 47.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
12836e61bc7a2c1ff302604a040f0f63ac36c5c947c20319fcb5d1ab37bac46e
BLAKE2b-256 checksum
How to use checksums
1ddd2495fe4d1ff804ec3094ad4c76cd0fcfb8902d630ce690118560a40df171
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.8.3 This release

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.2

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

1 release file

0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page