py-jokes-py


Namepy-jokes-py JSON
Version 1.1.3 PyPI version JSON
download
home_pagehttps://github.com/LoisaKitakaya/Jokes
SummaryPython wrapper for jokes APIs provided by icanhazdadjokes.com and jokeapi.dev
upload_time2023-06-23 06:57:06
maintainer
docs_urlNone
authorFreedom Loisa
requires_python>=3.9,<4.0
license
keywords python jokes api dad jokes
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # py-jokes-py

Python wrapper for the jokes APIs provided by:

- [icanhazdadjokes.com](https://icanhazdadjoke.com/)
- [jokeapi.dev](https://jokeapi.dev/)

## How to install

```
pip install py-jokes-py
```

## Usage

Something to note, the `jokes` module has two classes:

- `DadJokes()` - wrapper for [icanhazdadjokes.com](https://icanhazdadjoke.com/) api
- `AllJokes()` - wrapper for [jokeapi.dev](https://jokeapi.dev/) api

##### Class `DadJokes()`

This class provides the following methods:

- `random_joke_as_json(self)`
- `random_joke_as_text(self)`
- `specific_joke_as_json(self, id)`
- `specific_joke_as_text(self, id)`
- `list_jokes_as_json(self, page, limit, term)`
- `list_jokes_as_text(self, page, limit, term)`

##### Class `AllJokes()`

This class inherits from the `DadJokes` class, but also provides the following methods:

- `get_joke_json(self, joke_lang, joke_category, joke_flags, joke_type, joke_contains, joke_id, joke_amount)`
- `get_joke_text(self, joke_lang, joke_category, joke_flags, joke_type, joke_contains, joke_id, joke_amount)`

#### Basic Usage

```
from jokes.jokesv2 import AllJokes

jokes = AllJokes()

joke = jokes.get_joke_json()
print(joke)

joke = jokes.get_joke_text()
print(joke)

joke = jokes.random_joke_as_json()
print(joke)

joke = jokes.random_joke_as_text()
print(joke)

joke = jokes.specific_joke_as_json(id="12")
print(joke)

joke = jokes.specific_joke_as_text(id="12")
print(joke)

joke = jokes.list_jokes_as_json()
print(joke)

joke = jokes.list_jokes_as_text()
print(joke)
```

## Example

Here is a simple implementation of this package. Check it out:

- [jokes_cli](https://github.com/LoisaKitakaya/jokes_cli)

## Contribution

If you want to contribute to this project, here are some few steps you can follow:

- Fork this project's repository
- Clone it to your local machine
- Make the changes you want to make or add the features you want to add
- Write tests for the new features
- Make a pull request

That's just about it.

## Issues

For any issus encountered while using this package, feel free to submit a new issue [here](https://github.com/LoisaKitakaya/Jokes/issues).

Enjoy! 🤪
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/LoisaKitakaya/Jokes",
    "name": "py-jokes-py",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "python,jokes,api,dad jokes",
    "author": "Freedom Loisa",
    "author_email": "kitakayaloisa@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/0e/49/5aeefd406c579428ea366aa425f1a2746ce6822a72f4f3814c95055aff89/py_jokes_py-1.1.3.tar.gz",
    "platform": null,
    "description": "# py-jokes-py\n\nPython wrapper for the jokes APIs provided by:\n\n- [icanhazdadjokes.com](https://icanhazdadjoke.com/)\n- [jokeapi.dev](https://jokeapi.dev/)\n\n## How to install\n\n```\npip install py-jokes-py\n```\n\n## Usage\n\nSomething to note, the `jokes` module has two classes:\n\n- `DadJokes()` - wrapper for [icanhazdadjokes.com](https://icanhazdadjoke.com/) api\n- `AllJokes()` - wrapper for [jokeapi.dev](https://jokeapi.dev/) api\n\n##### Class `DadJokes()`\n\nThis class provides the following methods:\n\n- `random_joke_as_json(self)`\n- `random_joke_as_text(self)`\n- `specific_joke_as_json(self, id)`\n- `specific_joke_as_text(self, id)`\n- `list_jokes_as_json(self, page, limit, term)`\n- `list_jokes_as_text(self, page, limit, term)`\n\n##### Class `AllJokes()`\n\nThis class inherits from the `DadJokes` class, but also provides the following methods:\n\n- `get_joke_json(self, joke_lang, joke_category, joke_flags, joke_type, joke_contains, joke_id, joke_amount)`\n- `get_joke_text(self, joke_lang, joke_category, joke_flags, joke_type, joke_contains, joke_id, joke_amount)`\n\n#### Basic Usage\n\n```\nfrom jokes.jokesv2 import AllJokes\n\njokes = AllJokes()\n\njoke = jokes.get_joke_json()\nprint(joke)\n\njoke = jokes.get_joke_text()\nprint(joke)\n\njoke = jokes.random_joke_as_json()\nprint(joke)\n\njoke = jokes.random_joke_as_text()\nprint(joke)\n\njoke = jokes.specific_joke_as_json(id=\"12\")\nprint(joke)\n\njoke = jokes.specific_joke_as_text(id=\"12\")\nprint(joke)\n\njoke = jokes.list_jokes_as_json()\nprint(joke)\n\njoke = jokes.list_jokes_as_text()\nprint(joke)\n```\n\n## Example\n\nHere is a simple implementation of this package. Check it out:\n\n- [jokes_cli](https://github.com/LoisaKitakaya/jokes_cli)\n\n## Contribution\n\nIf you want to contribute to this project, here are some few steps you can follow:\n\n- Fork this project's repository\n- Clone it to your local machine\n- Make the changes you want to make or add the features you want to add\n- Write tests for the new features\n- Make a pull request\n\nThat's just about it.\n\n## Issues\n\nFor any issus encountered while using this package, feel free to submit a new issue [here](https://github.com/LoisaKitakaya/Jokes/issues).\n\nEnjoy! \ud83e\udd2a",
    "bugtrack_url": null,
    "license": "",
    "summary": "Python wrapper for jokes APIs provided by icanhazdadjokes.com and jokeapi.dev",
    "version": "1.1.3",
    "project_urls": {
        "Documentation": "https://github.com/LoisaKitakaya/Jokes#readme",
        "Homepage": "https://github.com/LoisaKitakaya/Jokes"
    },
    "split_keywords": [
        "python",
        "jokes",
        "api",
        "dad jokes"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a0e0504610ac8206b7800c7cf0c22670bb1b3d3a6bd28edf66aa11c70bb14f3e",
                "md5": "e5b8bd69aafb6efd42848f139ec91a8c",
                "sha256": "8d63f1f8f2fb12a1ba870255435f4e804025ccca2cf43faba31caeb891f18b1b"
            },
            "downloads": -1,
            "filename": "py_jokes_py-1.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e5b8bd69aafb6efd42848f139ec91a8c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 5280,
            "upload_time": "2023-06-23T06:57:04",
            "upload_time_iso_8601": "2023-06-23T06:57:04.662696Z",
            "url": "https://files.pythonhosted.org/packages/a0/e0/504610ac8206b7800c7cf0c22670bb1b3d3a6bd28edf66aa11c70bb14f3e/py_jokes_py-1.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0e495aeefd406c579428ea366aa425f1a2746ce6822a72f4f3814c95055aff89",
                "md5": "925d1ee2b616281b82be9462de02919e",
                "sha256": "59d776bbf0ea2f18ed4de8a3592e637eb7a66cff5798540c03fa400983dfc8c1"
            },
            "downloads": -1,
            "filename": "py_jokes_py-1.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "925d1ee2b616281b82be9462de02919e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 4206,
            "upload_time": "2023-06-23T06:57:06",
            "upload_time_iso_8601": "2023-06-23T06:57:06.318330Z",
            "url": "https://files.pythonhosted.org/packages/0e/49/5aeefd406c579428ea366aa425f1a2746ce6822a72f4f3814c95055aff89/py_jokes_py-1.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-23 06:57:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "LoisaKitakaya",
    "github_project": "Jokes",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "py-jokes-py"
}
        
Elapsed time: 0.11442s