Skip to main content

AI enabled error handling library

Project description

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.

Architecture Diagram

Architecture Digram

🛠️ 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.

  2. Install pyerrorhelper

    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

GitHub Personal Profile: Satyamaadi

🤝 Contributing

Contributions are welcome! Feel free to fork, open issues, or submit pull requests.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyerrorhelper-0.2.4.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyerrorhelper-0.2.4-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file pyerrorhelper-0.2.4.tar.gz.

File metadata

  • Download URL: pyerrorhelper-0.2.4.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for pyerrorhelper-0.2.4.tar.gz
Algorithm Hash digest
SHA256 4272c2d2ed6a8abf6d9a229bee6a75b9bc090e159f30d61790ec09ae7c0b5626
MD5 114e8715114e280461cd2cef0a8604c6
BLAKE2b-256 8418404735720a15b53d9ada10a684cbfc0a3f0574c53b0ae35f86ad6add5889

See more details on using hashes here.

File details

Details for the file pyerrorhelper-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: pyerrorhelper-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for pyerrorhelper-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5b8d0a40682f82799b4787e55afac86f20a904ce1b25fd54d9fdbdcab68fa364
MD5 4c7eef39b0927cf032f2e0e75cdc96d5
BLAKE2b-256 3206df10983e1592e62fa361a05ff10e6a6ac5cc8c4ebd9367c34311ff2c79fb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page