Skip to main content

A fun Python package that provides jokes for developers

Project description

Joke Center 🎭

A simple and extensible Python library for managing and retrieving jokes by category.

🚀 Features

  • Get random jokes by category
  • Add and delete jokes dynamically
  • Retrieve jokes across all categories
  • List available categories
  • Get multiple jokes at once
  • Built-in statistics support
  • Fully tested with pytest

📦 Installation

Install via pip:

pip install joke-center-wszms384

🔧 Usage

Basic Example

import joke_center

# Get a joke
print(joke_center.get_joke("programming"))

# Add a joke
joke_center.add_joke("programming", "Debugging is like being the detective in a crime movie where you are also the murderer.")

# Get random joke from all categories
print(joke_center.get_random_joke())

# List categories
print(joke_center.list_categories())

📚 API Reference

get_joke(category="programming")

Return a random joke from a category.


add_joke(category, joke)

Add a new joke.

  • Returns error if joke is empty

delete_joke(category, joke)

Delete a joke from a category.


list_categories()

Return all available categories.


get_random_joke()

Return a random joke from all categories.


get_all_jokes(category)

Return all jokes in a category.


get_multiple_jokes(category, n=1)

Return multiple random jokes.


get_stats()

Return statistics:

{
  "total_categories": 3,
  "total_jokes": 6
}

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_center_wszms384-0.3.1.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

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

joke_center_wszms384-0.3.1-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file joke_center_wszms384-0.3.1.tar.gz.

File metadata

  • Download URL: joke_center_wszms384-0.3.1.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for joke_center_wszms384-0.3.1.tar.gz
Algorithm Hash digest
SHA256 b52dbd91531d1de89aa8dc19eecbb845925a97596e0e1c5ff0c7f78741f3ac34
MD5 a41a0476160f3578b27bb3d652636c71
BLAKE2b-256 39df5033c8c129585215605458186aa10f9970aad76e8ddbd224d85b64e9d804

See more details on using hashes here.

File details

Details for the file joke_center_wszms384-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for joke_center_wszms384-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c1616d6fe05d5a5386b4f1d78e26df0adb47bcc79409001c6baee74ac1241ed5
MD5 222257c4ac5cc5f02f8cff9508820103
BLAKE2b-256 2506821f4abfcec543484e9b93bb66e4302a00d1139b51ddf4864a5187d5bb15

See more details on using hashes here.

Supported by

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