# ai-is-odd
[![PyPI version](https://badge.fury.io/py/ai-is-odd.svg)](https://badge.fury.io/py/ai-is-odd)
Why determine if something is odd or odd the usual way when you can do it with ✨AI✨?
Our library has 100% test coverage!
`ai-is-odd` is a Python library that uses OpenAI's GPT-4o-mini model to tell if a number is even or odd. Add some AI magic to your number-checking tasks!
## Installation
To install `ai-is-odd`, use pip:
```bash
pip install ai-is-odd
```
## SetupTo use is-odd, you’ll need an OpenAI API key. Get one by signing up at OpenAI.
1. Create a .env file in the root of your project.
2. Add your OpenAI API key to the .env file:
```
OPENAI_API_KEY=your-api-key
```
Replace `your-api-key` with your actual OpenAI API key.
## Usage
Here’s an example of how to use the `ai-is-odd` package in your project:
```
from ai_is_odd import is_odd
# Example usage
number = 5
result = is_odd(number)
print(f"Is {number} odd? {result}") # Output: Is 5 odd? True
```
## Function
`is_odd(number)`
- Parameters: `number` (int) - The number to check.
- Returns: `bool` - `True` if the number is odd, `False` if even.
- Raises: `ValueError` if the API response is inconclusive or if there's an issue with the request.
## Running Tests
To test the `is_odd` library, use the unittest framework:
```bash
python -m unittest discover -s tests
```
## Generating a Coverage Report
To check code coverage, make sure you have coverage installed:
```bash
pip install coverage
```
Run tests with coverage enabled:
```bash
coverage run -m unittest discover -s tests
```
To see a summary report in the terminal, use:
```bash
coverage report
```
To create a detailed HTML report:
```bash
coverage html
```
Open `htmlcov/index.html` in your browser to view the line-by-line coverage details.
## Contributing
Contributions are welcome! If you have suggestions or improvements, feel free to open an issue or submit a pull request.
## License
This project is licensed under the Apache 2.0 license.
Raw data
{
"_id": null,
"home_page": "https://github.com/arturshevchenko/ai_is_odd",
"name": "ai-is-odd",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "AI, EVEN, ODD",
"author": "Artur Shevchenko",
"author_email": "artur.shev8@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/7b/78/d70c3370dba3526eb9de0023db123def7e91f6a1f4858e8c0600b84d8844/ai_is_odd-0.1.2.tar.gz",
"platform": null,
"description": "# ai-is-odd\n\n[![PyPI version](https://badge.fury.io/py/ai-is-odd.svg)](https://badge.fury.io/py/ai-is-odd)\n\nWhy determine if something is odd or odd the usual way when you can do it with \u2728AI\u2728?\n\nOur library has 100% test coverage!\n\n`ai-is-odd` is a Python library that uses OpenAI's GPT-4o-mini model to tell if a number is even or odd. Add some AI magic to your number-checking tasks!\n\n## Installation\n\nTo install `ai-is-odd`, use pip:\n\n```bash\npip install ai-is-odd\n```\n\n## SetupTo use is-odd, you\u2019ll need an OpenAI API key. Get one by signing up at OpenAI.\n\n1. Create a .env file in the root of your project.\n2. Add your OpenAI API key to the .env file:\n\n```\nOPENAI_API_KEY=your-api-key\n```\nReplace `your-api-key` with your actual OpenAI API key.\n\n## Usage\nHere\u2019s an example of how to use the `ai-is-odd` package in your project:\n\n```\nfrom ai_is_odd import is_odd\n\n# Example usage\nnumber = 5\nresult = is_odd(number)\nprint(f\"Is {number} odd? {result}\") # Output: Is 5 odd? True\n```\n\n## Function\n`is_odd(number)`\n- Parameters: `number` (int) - The number to check.\n- Returns: `bool` - `True` if the number is odd, `False` if even.\n- Raises: `ValueError` if the API response is inconclusive or if there's an issue with the request.\n\n\n## Running Tests\nTo test the `is_odd` library, use the unittest framework:\n\n\n```bash\npython -m unittest discover -s tests\n```\n\n## Generating a Coverage Report\nTo check code coverage, make sure you have coverage installed:\n\n```bash\npip install coverage\n```\nRun tests with coverage enabled:\n```bash\ncoverage run -m unittest discover -s tests\n```\n\nTo see a summary report in the terminal, use:\n```bash\ncoverage report\n```\n\nTo create a detailed HTML report:\n```bash\ncoverage html\n```\n\nOpen `htmlcov/index.html` in your browser to view the line-by-line coverage details.\n\n## Contributing\nContributions are welcome! If you have suggestions or improvements, feel free to open an issue or submit a pull request.\n\n## License\nThis project is licensed under the Apache 2.0 license.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A super AI-powered library to determine if number is odd or odd with power of AI",
"version": "0.1.2",
"project_urls": {
"Homepage": "https://github.com/arturshevchenko/ai_is_odd"
},
"split_keywords": [
"ai",
" even",
" odd"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7b78d70c3370dba3526eb9de0023db123def7e91f6a1f4858e8c0600b84d8844",
"md5": "7bac98ec611c7ac46c7d05c1c6f5dd31",
"sha256": "c7d79723b9ec31a377fd566c8bf25fb92c3a5dd50153312ea7636223f2b5aef3"
},
"downloads": -1,
"filename": "ai_is_odd-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "7bac98ec611c7ac46c7d05c1c6f5dd31",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 7678,
"upload_time": "2024-10-28T08:19:10",
"upload_time_iso_8601": "2024-10-28T08:19:10.801782Z",
"url": "https://files.pythonhosted.org/packages/7b/78/d70c3370dba3526eb9de0023db123def7e91f6a1f4858e8c0600b84d8844/ai_is_odd-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-28 08:19:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "arturshevchenko",
"github_project": "ai_is_odd",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "ai-is-odd"
}