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.2.1.tar.gz (16.2 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.2.1-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: joke_center_wszms384-0.2.1.tar.gz
  • Upload date:
  • Size: 16.2 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.2.1.tar.gz
Algorithm Hash digest
SHA256 6d7a2b48479ea0c62623f764dd93afc1c363adda04374dfeeb62d176de253fa4
MD5 87c456147f2b03eb69e721036a81afdb
BLAKE2b-256 e7002b7827a6c8b1472edf81bc2825f95ee9d1fbe6e16d01400302a6f4dfbd3f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for joke_center_wszms384-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 afe3e282dcc5fc9c1f85e573b41e33b5ecfa61692f9be6547e4b4f6060fb3372
MD5 e340a24b6fe3aff0baa81666821ecf36
BLAKE2b-256 45dd2b35629dd439f185066bb435c985b1dc9ad498a1b00a26eca738b136cb9f

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