https://github.com/davep/textual-dad-joke
A dad joke widget for Textual. Seriously.
https://github.com/davep/textual-dad-joke
Last synced: 8 months ago
JSON representation
A dad joke widget for Textual. Seriously.
- Host: GitHub
- URL: https://github.com/davep/textual-dad-joke
- Owner: davep
- License: mit
- Created: 2024-01-04T22:18:23.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-11T21:53:40.000Z (over 2 years ago)
- Last Synced: 2025-01-20T06:59:22.706Z (over 1 year ago)
- Language: Python
- Size: 20.5 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Textual Dad Joke
## Introduction
This library provides a widget that displays a dad joke. No, I'm not even
kidding.
## Installing
The package can be installed with `pip` or related tools, for example:
```sh
$ pip install textual-dad-joke
```
## Then what?
Import it as you would any other widget from a library:
```python
from textual_dad_joke import DadJoke
```
and then compose the `DadJoke` widget into your application as you would any
other widget.
The widget has a `tell` method if you want it to tell another joke. It'll
also swallow any errors but will post a `DadJoke.FellFlat` message if there
was an error.
## Erm... okay. Anything else I should know?
The widget needs an internet connection and is using
[icanhazdadjoke.com](https://icanhazdadjoke.com/) as the backend. Also, I
won't be held responsible for the content of any joke served. That's all on
you.
[//]: # (README.md ends here)