Metadata-Version: 2.4
Name: kjokes
Version: 0.1.0
Summary: A lightweight Python library for fetching jokes from the Official Joke API.
Project-URL: Homepage of the API, https://official-joke-api.appspot.com/
Project-URL: Bug Tracker (author), https://github.com/karlevans0110/kjokes/issues
Author-email: Karl Evans <karl.evans.team@gmail.com>
License-File: LICENSE
Keywords: api,cli,humor,joke,jokes
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.12
Requires-Dist: requests
Description-Content-Type: text/markdown

# 🐍 kjokes 
> Because a joke a day keeps all the bugs away!
## A Python library made for joking
### kjokes was made to allow you to fetch jokes in your code. It's lightweight, so it doesn't mess much with your efficiency. It was made using the Official Joke API

## 🛠️Instalation
* **1. Using normal pip**
    Just type `pip install kjokes` in your terminal
    ```powershell
    pip install kjokes 
    ```
* **2. Using uv globally**
    Just type `uv pip install kjokes` in your terminal
    ```powershell
    uv pip install kjokes 
    ```
* **3. Using uv for a project**
    Just type `uv add kjokes` in your PROJECT'S terminal
    ```powershell
    uv add kjokes 
    ```
> To be sure it works adding `py -m` infront of the command is recomended

## ⚙️Use
### *Quick use in the terminal*
* **Type `kjoke` or `uv run kjoke` for a joke**
    ```powershell
    kjoke      uv run kjoke
    ```
### *Using kjokes in your code*
1. Import the library
    ```python
    import kjokes #(you can also shorten it with 'as', eg. import kjokes as kj)
    ```
2. Get a joke
    ```python
    joke = kjokes.get_joke()
    ```
* You can also specify the category
    ```python
    joke = get_joke(category='programming') or joke = get_joke('programming')
    ```
3. Print your result
    ```python
    print(joke)
    #Result: e.g. How many programmers does it take to change a lightbulb? None that's a hardware problem
    ```
* Example of a ready, working code
    ```python
    import kjokes as kj
    joke = kj.get_joke('programming')
    print(joke)
    #Result: Which song would an exception sing? Can't catch me - Avicii
    ```

## 🎭Categories of jokes
* general
* programming
* knock-knock
* random (default)
> Type one of these exact category names into the function

## 🛡️Built-in reliability guardians
kjokes is designed to be "crash-proof". It handles:
- [✅] Connection Errors: Friendly messages instead of scary red tracebacks.
- [✅] Timeouts: Won't hang your terminal if the API is slow.
- [✅] Invalid Categories: Guides you to use `khelp` if you mistype a category.
- [✅] Server Issues: Gracefully handles 404s and 500s.

## 📜License
**This project is licensed under the MIT License — free to use, modify, and share**

Copyright 2026 Karl Evans

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.