gooderror


Namegooderror JSON
Version 0.0.3 PyPI version JSON
download
home_pagehttps://github.com/TeaByte/GoodError/
SummaryGoodError is a Python library that enhances exception handling, including integration with GPT-3 for additional context.
upload_time2023-09-13 21:36:33
maintainer
docs_urlNone
author01270
requires_python
license
keywords exception handling gpt-3 python library
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
![Alt Text](https://i.ibb.co/LdxyRp5/image-2023-09-13-23-36-08.png)

# GoodError Documentation

The GoodError library provides an improved exception handling mechanism in Python. It allows you to enhance the output of exceptions, including sending them to GPT-3 for additional context.

## Installation

To install GoodError, use pip:

```bash
pip install gooderror
```


## Example

Here's an example of how to use GoodError:

```python
from gooderror import GoodError

GoodError()

x = "SADfsadf" + 5

# GoodError will enhance the exception output and will add COLORS!
# OUTPUT:
#<module>, TypeError(Can only concatenate str (not "int") to str)
#main, Line 82 -> m = "SADfsadf" + 5

```

## Class: GoodError

The GoodError class provides the following attributes and methods:

### Attributes

- `gpt_key` (str): Your GPT API key.
- `use_colors` (bool): Whether to use colors in the output.


## GPT3.5 Usage

Import the GoodError class and initialize it with your GPT API key.

```python
from gooderror import GoodError

# Initialize GoodError with your GPT API key
GoodError(gpt_key="YOUR_GPT_API_KEY")

result = 0/0

# OUTPUT:
#<module>, ZeroDivisionError(Division by zero)
#main, Line 80 -> result = 0/0

#Waiting for GPT to respond...

#The error "ZeroDivisionError" is raised when you try to divide a number by zero in Python. Division by zero is not defined in mathematics, hence this error is generated to indicate an invalid operation.
#To fix this error, you need to make sure you do not divide a number by zero. If the denominator can potentially be zero in your code, you can add a check to handle this scenario using an if condition. For example:

#try:
#    result = 0/0
#except ZeroDivisionError:
#    print("Cannot divide by zero")

#In this case, if the division operation encounters a ZeroDivisionError, it will be caught by the except block, which will then print the error message.

```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/TeaByte/GoodError/",
    "name": "gooderror",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "exception handling,GPT-3,Python library",
    "author": "01270",
    "author_email": "yazanemails@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/7b/96/8a4c15cf5244efc22f341faa755f714ab18bb46f44c09e90e08e6490a5bd/gooderror-0.0.3.tar.gz",
    "platform": null,
    "description": "\r\n![Alt Text](https://i.ibb.co/LdxyRp5/image-2023-09-13-23-36-08.png)\r\n\r\n# GoodError Documentation\r\n\r\nThe GoodError library provides an improved exception handling mechanism in Python. It allows you to enhance the output of exceptions, including sending them to GPT-3 for additional context.\r\n\r\n## Installation\r\n\r\nTo install GoodError, use pip:\r\n\r\n```bash\r\npip install gooderror\r\n```\r\n\r\n\r\n## Example\r\n\r\nHere's an example of how to use GoodError:\r\n\r\n```python\r\nfrom gooderror import GoodError\r\n\r\nGoodError()\r\n\r\nx = \"SADfsadf\" + 5\r\n\r\n# GoodError will enhance the exception output and will add COLORS!\r\n# OUTPUT:\r\n#<module>, TypeError(Can only concatenate str (not \"int\") to str)\r\n#main, Line 82 -> m = \"SADfsadf\" + 5\r\n\r\n```\r\n\r\n## Class: GoodError\r\n\r\nThe GoodError class provides the following attributes and methods:\r\n\r\n### Attributes\r\n\r\n- `gpt_key` (str): Your GPT API key.\r\n- `use_colors` (bool): Whether to use colors in the output.\r\n\r\n\r\n## GPT3.5 Usage\r\n\r\nImport the GoodError class and initialize it with your GPT API key.\r\n\r\n```python\r\nfrom gooderror import GoodError\r\n\r\n# Initialize GoodError with your GPT API key\r\nGoodError(gpt_key=\"YOUR_GPT_API_KEY\")\r\n\r\nresult = 0/0\r\n\r\n# OUTPUT:\r\n#<module>, ZeroDivisionError(Division by zero)\r\n#main, Line 80 -> result = 0/0\r\n\r\n#Waiting for GPT to respond...\r\n\r\n#The error \"ZeroDivisionError\" is raised when you try to divide a number by zero in Python. Division by zero is not defined in mathematics, hence this error is generated to indicate an invalid operation.\r\n#To fix this error, you need to make sure you do not divide a number by zero. If the denominator can potentially be zero in your code, you can add a check to handle this scenario using an if condition. For example:\r\n\r\n#try:\r\n#    result = 0/0\r\n#except ZeroDivisionError:\r\n#    print(\"Cannot divide by zero\")\r\n\r\n#In this case, if the division operation encounters a ZeroDivisionError, it will be caught by the except block, which will then print the error message.\r\n\r\n```\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "GoodError is a Python library that enhances exception handling, including integration with GPT-3 for additional context.",
    "version": "0.0.3",
    "project_urls": {
        "Bug Reports": "https://github.com/TeaByte/GoodError/issues",
        "Documentation": "https://github.com/TeaByte/GoodError/",
        "Homepage": "https://github.com/TeaByte/GoodError/",
        "Source": "https://github.com/TeaByte/GoodError/"
    },
    "split_keywords": [
        "exception handling",
        "gpt-3",
        "python library"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9b464b9dad3247fc9520a775ba7e0d9d651b48fb3842bd39f9c2c3b3d90b083f",
                "md5": "4a19bc286e0661b5ec472a8f92376ac5",
                "sha256": "ba47e5abd2d7066ad3654a0b2721c1f2bd71151155c8490ef8ca22dae2d6c83e"
            },
            "downloads": -1,
            "filename": "gooderror-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4a19bc286e0661b5ec472a8f92376ac5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 3348,
            "upload_time": "2023-09-13T21:36:32",
            "upload_time_iso_8601": "2023-09-13T21:36:32.295855Z",
            "url": "https://files.pythonhosted.org/packages/9b/46/4b9dad3247fc9520a775ba7e0d9d651b48fb3842bd39f9c2c3b3d90b083f/gooderror-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7b968a4c15cf5244efc22f341faa755f714ab18bb46f44c09e90e08e6490a5bd",
                "md5": "a8e87cc20289d78ece7b45167d144673",
                "sha256": "21d4c1b12cf4c5f9db741ca894b52790b901341783df49b92213a894e2dea1e7"
            },
            "downloads": -1,
            "filename": "gooderror-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "a8e87cc20289d78ece7b45167d144673",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3705,
            "upload_time": "2023-09-13T21:36:33",
            "upload_time_iso_8601": "2023-09-13T21:36:33.454761Z",
            "url": "https://files.pythonhosted.org/packages/7b/96/8a4c15cf5244efc22f341faa755f714ab18bb46f44c09e90e08e6490a5bd/gooderror-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-13 21:36:33",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "TeaByte",
    "github_project": "GoodError",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "gooderror"
}
        
Elapsed time: 0.11344s