python-error


Namepython-error JSON
Version 1.0.7 PyPI version JSON
download
home_pagehttps://github.com/pb2204/py-error-handling-toolkit
SummaryError Handling and Logging Toolkit for Python
upload_time2023-09-26 16:15:19
maintainer
docs_urlNone
authorPB2204 (Pabitra Banerjee)
requires_python
license
keywords python error log error handling debugging
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
**`README.md`**

# Error Handling and Logging Toolkit for Python



A Python toolkit that provides enhanced error handling and logging capabilities, making it easier to identify and debug runtime errors when they occur.



## Features



- Custom error handling with `CustomError` class.

- Flexible error logging with customizable log formats.

- Example usage and unit tests included.



## Installation



You can install the toolkit using pip:



```bash

pip install py-error-handling-toolkit

```



## Usage



Here's how you can use the toolkit in your Python code:



```python

from toolkit.error_handler import CustomError, handle_error

from toolkit.logger import setup_logger



# Initialize the logger

logger = setup_logger('error.log')



try:

    # Code that may raise exceptions

    raise CustomError("This is a custom error.")

except CustomError as ce:

    handle_error(ce, log_function=logger.error)

except Exception as e:

    handle_error(e, log_function=logger.error)

else:

    logger.info("No errors occurred.")

```



For more detailed usage instructions, see the [full documentation](https://github.com/yourusername/py-error-handling-toolkit).



## Contributing



Contributions are welcome! Please check out the [contribution guidelines](CONTRIBUTING.md) for details on how to contribute to this project.



## License



This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pb2204/py-error-handling-toolkit",
    "name": "python-error",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "python,error,log,error handling,debugging",
    "author": "PB2204 (Pabitra Banerjee)",
    "author_email": "<rockstarpabitra2204@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/f6/54/4c9d8afb6af4a2a0c6c9277360dadef676c13efe2c6f1400cd165ff52f76/python-error-1.0.7.tar.gz",
    "platform": null,
    "description": "\r\n**`README.md`**\r\n\r\n# Error Handling and Logging Toolkit for Python\r\n\r\n\r\n\r\nA Python toolkit that provides enhanced error handling and logging capabilities, making it easier to identify and debug runtime errors when they occur.\r\n\r\n\r\n\r\n## Features\r\n\r\n\r\n\r\n- Custom error handling with `CustomError` class.\r\n\r\n- Flexible error logging with customizable log formats.\r\n\r\n- Example usage and unit tests included.\r\n\r\n\r\n\r\n## Installation\r\n\r\n\r\n\r\nYou can install the toolkit using pip:\r\n\r\n\r\n\r\n```bash\r\n\r\npip install py-error-handling-toolkit\r\n\r\n```\r\n\r\n\r\n\r\n## Usage\r\n\r\n\r\n\r\nHere's how you can use the toolkit in your Python code:\r\n\r\n\r\n\r\n```python\r\n\r\nfrom toolkit.error_handler import CustomError, handle_error\r\n\r\nfrom toolkit.logger import setup_logger\r\n\r\n\r\n\r\n# Initialize the logger\r\n\r\nlogger = setup_logger('error.log')\r\n\r\n\r\n\r\ntry:\r\n\r\n    # Code that may raise exceptions\r\n\r\n    raise CustomError(\"This is a custom error.\")\r\n\r\nexcept CustomError as ce:\r\n\r\n    handle_error(ce, log_function=logger.error)\r\n\r\nexcept Exception as e:\r\n\r\n    handle_error(e, log_function=logger.error)\r\n\r\nelse:\r\n\r\n    logger.info(\"No errors occurred.\")\r\n\r\n```\r\n\r\n\r\n\r\nFor more detailed usage instructions, see the [full documentation](https://github.com/yourusername/py-error-handling-toolkit).\r\n\r\n\r\n\r\n## Contributing\r\n\r\n\r\n\r\nContributions are welcome! Please check out the [contribution guidelines](CONTRIBUTING.md) for details on how to contribute to this project.\r\n\r\n\r\n\r\n## License\r\n\r\n\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Error Handling and Logging Toolkit for Python",
    "version": "1.0.7",
    "project_urls": {
        "Homepage": "https://github.com/pb2204/py-error-handling-toolkit"
    },
    "split_keywords": [
        "python",
        "error",
        "log",
        "error handling",
        "debugging"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dae354a717583df375498aa1d6651ea797c268124037d117deff696e86da88ff",
                "md5": "81f3e426f21fdceb36836a504752b140",
                "sha256": "18d80a775dbc8716ce533acdebde0a38c652f2fa34083adf95552442e32c3d61"
            },
            "downloads": -1,
            "filename": "python_error-1.0.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "81f3e426f21fdceb36836a504752b140",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 1941,
            "upload_time": "2023-09-26T16:15:16",
            "upload_time_iso_8601": "2023-09-26T16:15:16.994048Z",
            "url": "https://files.pythonhosted.org/packages/da/e3/54a717583df375498aa1d6651ea797c268124037d117deff696e86da88ff/python_error-1.0.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f6544c9d8afb6af4a2a0c6c9277360dadef676c13efe2c6f1400cd165ff52f76",
                "md5": "9f3fc9f55c29fd1d71b671dc66fd8025",
                "sha256": "adb0864a8dba8756f68a54a9119406cc17ca334fbdff380d8bd06fe4bde258b8"
            },
            "downloads": -1,
            "filename": "python-error-1.0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "9f3fc9f55c29fd1d71b671dc66fd8025",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 2240,
            "upload_time": "2023-09-26T16:15:19",
            "upload_time_iso_8601": "2023-09-26T16:15:19.112310Z",
            "url": "https://files.pythonhosted.org/packages/f6/54/4c9d8afb6af4a2a0c6c9277360dadef676c13efe2c6f1400cd165ff52f76/python-error-1.0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-26 16:15:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pb2204",
    "github_project": "py-error-handling-toolkit",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "python-error"
}
        
Elapsed time: 0.11822s