<!-- markdownlint-disable -->
<p align="center">
<a href="https://github.com/TheGrotShop/">
<img src="https://cdn.wolfsoftware.com/assets/images/github/organisations/thegrotshop/black-and-white-circle-256.png" alt="TheGrotShop logo" />
</a>
<br />
<a href="https://github.com/TheGrotShop/magic-8ball/actions/workflows/cicd.yml">
<img src="https://img.shields.io/github/actions/workflow/status/TheGrotShop/magic-8ball/cicd.yml?branch=master&label=build%20status&style=for-the-badge" alt="Github Build Status" />
</a>
<a href="https://github.com/TheGrotShop/magic-8ball/blob/master/LICENSE.md">
<img src="https://img.shields.io/github/license/TheGrotShop/magic-8ball?color=blue&label=License&style=for-the-badge" alt="License">
</a>
<a href="https://github.com/TheGrotShop/magic-8ball">
<img src="https://img.shields.io/github/created-at/TheGrotShop/magic-8ball?color=blue&label=Created&style=for-the-badge" alt="Created">
</a>
<br />
<a href="https://github.com/TheGrotShop/magic-8ball/releases/latest">
<img src="https://img.shields.io/github/v/release/TheGrotShop/magic-8ball?color=blue&label=Latest%20Release&style=for-the-badge" alt="Release">
</a>
<a href="https://github.com/TheGrotShop/magic-8ball/releases/latest">
<img src="https://img.shields.io/github/release-date/TheGrotShop/magic-8ball?color=blue&label=Released&style=for-the-badge" alt="Released">
</a>
<a href="https://github.com/TheGrotShop/magic-8ball/releases/latest">
<img src="https://img.shields.io/github/commits-since/TheGrotShop/magic-8ball/latest.svg?color=blue&style=for-the-badge" alt="Commits since release">
</a>
<br />
<a href="https://github.com/TheGrotShop/magic-8ball/blob/master/.github/CODE_OF_CONDUCT.md">
<img src="https://img.shields.io/badge/Code%20of%20Conduct-blue?style=for-the-badge" />
</a>
<a href="https://github.com/TheGrotShop/magic-8ball/blob/master/.github/CONTRIBUTING.md">
<img src="https://img.shields.io/badge/Contributing-blue?style=for-the-badge" />
</a>
<a href="https://github.com/TheGrotShop/magic-8ball/blob/master/.github/SECURITY.md">
<img src="https://img.shields.io/badge/Report%20Security%20Concern-blue?style=for-the-badge" />
</a>
<a href="https://github.com/TheGrotShop/magic-8ball/issues">
<img src="https://img.shields.io/badge/Get%20Support-blue?style=for-the-badge" />
</a>
</p>
## Overview
## Overview
`Magic 8-Ball` is a Python package that emulates the classic Magic 8-Ball toy, providing randomized responses to yes-or-no questions. This package is
designed to be both interactive and usable in various applications, allowing developers to integrate a fun, nostalgic feature into their projects.
## Features
- 20 traditional Magic 8-Ball responses (positive, neutral, and negative).
- Simple API to ask questions and get a response.
- Custom error handling for invalid inputs.
- Includes comprehensive test coverage.
## Installation
```bash
pip install wolfsoftware.magic8ball
```
## Usage
### Basic Example
Once installed, you can use the Magic 8-Ball package in your Python code.
```python
from wolfsoftware.magic8ball import Magic8Ball
# Create an instance of Magic8Ball
magic_ball = Magic8Ball()
# Ask a yes/no question
response = magic_ball.ask_question("Will it rain tomorrow?")
print("Magic 8-Ball says:", response)
```
### Handling Errors
The `ask_question` method raises an `InvalidQuestionError` if the question provided is not a non-empty string. Make sure to validate the input or handle
this exception as shown:
```python
from wolfsoftware.magic8ball import Magic8Ball, InvalidQuestionError
magic_ball = Magic8Ball()
try:
response = magic_ball.ask_question("Will I get a promotion?")
print("Magic 8-Ball says:", response)
except InvalidQuestionError as e:
print("Error:", e)
```
<br />
<p align="right"><a href="https://wolfsoftware.com/"><img src="https://img.shields.io/badge/Created%20by%20Wolf%20on%20behalf%20of%20Wolf%20Software-blue?style=for-the-badge" /></a></p>
Raw data
{
"_id": null,
"home_page": "https://github.com/TheGrotShop/magic8ball",
"name": "wolfsoftware.magic8ball",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "python, template",
"author": "Wolf Software",
"author_email": "pypi@wolfsoftware.com",
"download_url": "https://files.pythonhosted.org/packages/e5/ad/f0696a385d067a925e525e34ae72b9b97540a7d88972b1673a8db703f598/wolfsoftware_magic8ball-0.1.0.tar.gz",
"platform": null,
"description": "<!-- markdownlint-disable -->\n<p align=\"center\">\n <a href=\"https://github.com/TheGrotShop/\">\n <img src=\"https://cdn.wolfsoftware.com/assets/images/github/organisations/thegrotshop/black-and-white-circle-256.png\" alt=\"TheGrotShop logo\" />\n </a>\n <br />\n <a href=\"https://github.com/TheGrotShop/magic-8ball/actions/workflows/cicd.yml\">\n <img src=\"https://img.shields.io/github/actions/workflow/status/TheGrotShop/magic-8ball/cicd.yml?branch=master&label=build%20status&style=for-the-badge\" alt=\"Github Build Status\" />\n </a>\n <a href=\"https://github.com/TheGrotShop/magic-8ball/blob/master/LICENSE.md\">\n <img src=\"https://img.shields.io/github/license/TheGrotShop/magic-8ball?color=blue&label=License&style=for-the-badge\" alt=\"License\">\n </a>\n <a href=\"https://github.com/TheGrotShop/magic-8ball\">\n <img src=\"https://img.shields.io/github/created-at/TheGrotShop/magic-8ball?color=blue&label=Created&style=for-the-badge\" alt=\"Created\">\n </a>\n <br />\n <a href=\"https://github.com/TheGrotShop/magic-8ball/releases/latest\">\n <img src=\"https://img.shields.io/github/v/release/TheGrotShop/magic-8ball?color=blue&label=Latest%20Release&style=for-the-badge\" alt=\"Release\">\n </a>\n <a href=\"https://github.com/TheGrotShop/magic-8ball/releases/latest\">\n <img src=\"https://img.shields.io/github/release-date/TheGrotShop/magic-8ball?color=blue&label=Released&style=for-the-badge\" alt=\"Released\">\n </a>\n <a href=\"https://github.com/TheGrotShop/magic-8ball/releases/latest\">\n <img src=\"https://img.shields.io/github/commits-since/TheGrotShop/magic-8ball/latest.svg?color=blue&style=for-the-badge\" alt=\"Commits since release\">\n </a>\n <br />\n <a href=\"https://github.com/TheGrotShop/magic-8ball/blob/master/.github/CODE_OF_CONDUCT.md\">\n <img src=\"https://img.shields.io/badge/Code%20of%20Conduct-blue?style=for-the-badge\" />\n </a>\n <a href=\"https://github.com/TheGrotShop/magic-8ball/blob/master/.github/CONTRIBUTING.md\">\n <img src=\"https://img.shields.io/badge/Contributing-blue?style=for-the-badge\" />\n </a>\n <a href=\"https://github.com/TheGrotShop/magic-8ball/blob/master/.github/SECURITY.md\">\n <img src=\"https://img.shields.io/badge/Report%20Security%20Concern-blue?style=for-the-badge\" />\n </a>\n <a href=\"https://github.com/TheGrotShop/magic-8ball/issues\">\n <img src=\"https://img.shields.io/badge/Get%20Support-blue?style=for-the-badge\" />\n </a>\n</p>\n\n## Overview\n\n## Overview\n\n`Magic 8-Ball` is a Python package that emulates the classic Magic 8-Ball toy, providing randomized responses to yes-or-no questions. This package is\ndesigned to be both interactive and usable in various applications, allowing developers to integrate a fun, nostalgic feature into their projects.\n\n## Features\n\n- 20 traditional Magic 8-Ball responses (positive, neutral, and negative).\n- Simple API to ask questions and get a response.\n- Custom error handling for invalid inputs.\n- Includes comprehensive test coverage.\n\n## Installation\n\n```bash\npip install wolfsoftware.magic8ball\n```\n\n## Usage\n\n### Basic Example\n\nOnce installed, you can use the Magic 8-Ball package in your Python code.\n\n```python\nfrom wolfsoftware.magic8ball import Magic8Ball\n\n# Create an instance of Magic8Ball\nmagic_ball = Magic8Ball()\n\n# Ask a yes/no question\nresponse = magic_ball.ask_question(\"Will it rain tomorrow?\")\nprint(\"Magic 8-Ball says:\", response)\n```\n\n### Handling Errors\n\nThe `ask_question` method raises an `InvalidQuestionError` if the question provided is not a non-empty string. Make sure to validate the input or handle\nthis exception as shown:\n\n```python\nfrom wolfsoftware.magic8ball import Magic8Ball, InvalidQuestionError\n\nmagic_ball = Magic8Ball()\n\ntry:\n response = magic_ball.ask_question(\"Will I get a promotion?\")\n print(\"Magic 8-Ball says:\", response)\nexcept InvalidQuestionError as e:\n print(\"Error:\", e)\n```\n\n<br />\n<p align=\"right\"><a href=\"https://wolfsoftware.com/\"><img src=\"https://img.shields.io/badge/Created%20by%20Wolf%20on%20behalf%20of%20Wolf%20Software-blue?style=for-the-badge\" /></a></p>\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A simple package to implement a Magic 8Ball.",
"version": "0.1.0",
"project_urls": {
"Documentation": "https://github.com/TheGrotShop/magic8ball",
"Homepage": "https://github.com/TheGrotShop/magic8ball",
"Source": "https://github.com/TheGrotShop/magic8ball",
"Sponsor": "https://github.com/sponsors/WolfSoftware",
"Tracker": "https://github.com/TheGrotShop/magic8ball/issues/"
},
"split_keywords": [
"python",
" template"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "370a7b890ed078c6f516bbb3892e2bce7e3efee658a03cd945007ccc4dd3f39d",
"md5": "438390e11a09b4438f18ed9b2746fca0",
"sha256": "dc94beac4fffd8a66eab0777731cc4933a06ed6b3530715a361614afa7b2a8b5"
},
"downloads": -1,
"filename": "wolfsoftware.magic8ball-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "438390e11a09b4438f18ed9b2746fca0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 5786,
"upload_time": "2024-11-14T13:59:14",
"upload_time_iso_8601": "2024-11-14T13:59:14.294826Z",
"url": "https://files.pythonhosted.org/packages/37/0a/7b890ed078c6f516bbb3892e2bce7e3efee658a03cd945007ccc4dd3f39d/wolfsoftware.magic8ball-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e5adf0696a385d067a925e525e34ae72b9b97540a7d88972b1673a8db703f598",
"md5": "9dc69f40dfc492317f31b69eb2228f09",
"sha256": "cb899c2815c857d1915d5d88374ebfd884b5a0e135362f75114ace9a5384bd37"
},
"downloads": -1,
"filename": "wolfsoftware_magic8ball-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "9dc69f40dfc492317f31b69eb2228f09",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 6847,
"upload_time": "2024-11-14T13:59:15",
"upload_time_iso_8601": "2024-11-14T13:59:15.351287Z",
"url": "https://files.pythonhosted.org/packages/e5/ad/f0696a385d067a925e525e34ae72b9b97540a7d88972b1673a8db703f598/wolfsoftware_magic8ball-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-14 13:59:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "TheGrotShop",
"github_project": "magic8ball",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "wolfsoftware.magic8ball"
}