# pyerrorhelper
> 🧠 AI-enabled Python library for **runtime error explainability**.
---
## 📖 Description
`pyerrorhelper` is a Python library that brings **AI-powered error explainability** into your runtime environment.
### Why?
Developers typically use AI **before** running code (for generation) or **after** running code (for debugging).
This package enables AI **during execution**, so your running Python programs can leverage AI-driven insights in real time.
### Key Objectives
- **Runtime AI integration** – Make AI available inside the running program (starting with error explainability).
- **Retrofit older systems** – Allow existing Python systems to adopt AI workflows with minimal changes [this is the future i wanna build].
- **Free & local AI models** – Works with free AI solutions - using [Ollama](https://www.ollama.com).
---
## Architecture Diagram

## 🛠️ Working
There are two main components (class) in the system -
- ErrorMananger (manager.py) -
install - this method handles overriding sys.excepthook with custom method.
process_exception - this method calls the second component (OllamaEmbedder) and helps in summarizing the error
uninstall - this method makes the sys.excepthook as default error handling way
- OllamEmbedder (ollamaembedder.py) -
ensure_ollama_installed - this method ensures that Ollama is installed, if not - it tries installing it via curl command
summarize - this method uses the Ollama supported GPT model to summarize the errors
## 🔀 Flow of control -
- When we use install() of ErrorManager -> sys.excepthook is overridden
- and at the same time -> OllamaEmbedder is initialised and it checks for Ollama installation on local system
- if its not present -> it tries to install the Ollama backend
- After the installation of Ollama -> the system is activated, ready to catch any error and summarize it
## ⚙️ Installation
1. **Install Python**
Download and install from [python.org](https://www.python.org/downloads/).
2. **Install pyerrorhelper**
```bash
pip install pyerrorhelper
```
3. **Usage**
```
from pyerrorhelper import ErrorManager
class Test:
def __init__(self):
self.error_manager = ErrorManager()
self.error_manager.install()
def some_function(self):
cause_some_error()
```
## 👨💻 About Me
Name: Shikhar Aditya
Email: satyamshikhar@gmail.com
Github Repo Link: [pyerrorhandler](https://github.com/Satyamaadi/pyerrorhelper)
GitHub Personal Profile: [Satyamaadi](https://github.com/Satyamaadi)
## 🤝 Contributing
Contributions are welcome! Feel free to fork, open issues, or submit pull requests.
Raw data
{
"_id": null,
"home_page": null,
"name": "pyerrorhelper",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "error-handling, middleware, python, ai, ai-error-handling, ai-error-summarization",
"author": null,
"author_email": "Shikhar Aditya <satyamshikhar@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/c0/ad/847ac91e9752a60efbb0f699bc76592dc813a5589bc028813af99ad207f7/pyerrorhelper-0.2.5.tar.gz",
"platform": null,
"description": "# pyerrorhelper\n\n> \ud83e\udde0 AI-enabled Python library for **runtime error explainability**.\n\n---\n\n## \ud83d\udcd6 Description\n\n`pyerrorhelper` is a Python library that brings **AI-powered error explainability** into your runtime environment.\n\n### Why?\nDevelopers typically use AI **before** running code (for generation) or **after** running code (for debugging).\nThis package enables AI **during execution**, so your running Python programs can leverage AI-driven insights in real time.\n\n### Key Objectives\n- **Runtime AI integration** \u2013 Make AI available inside the running program (starting with error explainability).\n- **Retrofit older systems** \u2013 Allow existing Python systems to adopt AI workflows with minimal changes [this is the future i wanna build].\n- **Free & local AI models** \u2013 Works with free AI solutions - using [Ollama](https://www.ollama.com).\n\n---\n\n## Architecture Diagram\n\n\n\n## \ud83d\udee0\ufe0f Working\n\nThere are two main components (class) in the system - \n\n- ErrorMananger (manager.py) -\n install - this method handles overriding sys.excepthook with custom method.\n process_exception - this method calls the second component (OllamaEmbedder) and helps in summarizing the error\n uninstall - this method makes the sys.excepthook as default error handling way\n\n- OllamEmbedder (ollamaembedder.py) - \n ensure_ollama_installed - this method ensures that Ollama is installed, if not - it tries installing it via curl command\n summarize - this method uses the Ollama supported GPT model to summarize the errors\n\n## \ud83d\udd00 Flow of control - \n\n- When we use install() of ErrorManager -> sys.excepthook is overridden\n- and at the same time -> OllamaEmbedder is initialised and it checks for Ollama installation on local system\n- if its not present -> it tries to install the Ollama backend\n- After the installation of Ollama -> the system is activated, ready to catch any error and summarize it\n\n\n## \u2699\ufe0f Installation\n\n1. **Install Python**\n Download and install from [python.org](https://www.python.org/downloads/).\n\n2. **Install pyerrorhelper**\n ```bash\n pip install pyerrorhelper\n ```\n\n3. **Usage**\n```\nfrom pyerrorhelper import ErrorManager\n\nclass Test:\n def __init__(self):\n self.error_manager = ErrorManager()\n self.error_manager.install()\n \n def some_function(self):\n cause_some_error()\n```\n## \ud83d\udc68\u200d\ud83d\udcbb About Me\n\nName: Shikhar Aditya\n\nEmail: satyamshikhar@gmail.com\n\nGithub Repo Link: [pyerrorhandler](https://github.com/Satyamaadi/pyerrorhelper)\n\nGitHub Personal Profile: [Satyamaadi](https://github.com/Satyamaadi)\n\n## \ud83e\udd1d Contributing\n\nContributions are welcome! Feel free to fork, open issues, or submit pull requests.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "AI enabled error handling library",
"version": "0.2.5",
"project_urls": null,
"split_keywords": [
"error-handling",
" middleware",
" python",
" ai",
" ai-error-handling",
" ai-error-summarization"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "ef029cda75a289b735026a6e899eab24979881bdb2b1295d0c6c9bd9cfc9e8e5",
"md5": "92df0c054aa4f331ad1c7bf91916fe46",
"sha256": "18684512e838bfa6618e689b357b9b89100df78e659c223e9cb66ff87a4532f2"
},
"downloads": -1,
"filename": "pyerrorhelper-0.2.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "92df0c054aa4f331ad1c7bf91916fe46",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 5614,
"upload_time": "2025-08-31T13:46:40",
"upload_time_iso_8601": "2025-08-31T13:46:40.704423Z",
"url": "https://files.pythonhosted.org/packages/ef/02/9cda75a289b735026a6e899eab24979881bdb2b1295d0c6c9bd9cfc9e8e5/pyerrorhelper-0.2.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "c0ad847ac91e9752a60efbb0f699bc76592dc813a5589bc028813af99ad207f7",
"md5": "06d47f40e0ea82541cc8fa3d4d6b3adc",
"sha256": "5dabf303ab4df7bd81bd54786c8a086e23dbc6b6cf6cce123b7f741317c20762"
},
"downloads": -1,
"filename": "pyerrorhelper-0.2.5.tar.gz",
"has_sig": false,
"md5_digest": "06d47f40e0ea82541cc8fa3d4d6b3adc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 4648,
"upload_time": "2025-08-31T13:46:41",
"upload_time_iso_8601": "2025-08-31T13:46:41.927223Z",
"url": "https://files.pythonhosted.org/packages/c0/ad/847ac91e9752a60efbb0f699bc76592dc813a5589bc028813af99ad207f7/pyerrorhelper-0.2.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-31 13:46:41",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pyerrorhelper"
}