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.5.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.5-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyerrorhelper-0.2.5.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.5.tar.gz
Algorithm Hash digest
SHA256 5dabf303ab4df7bd81bd54786c8a086e23dbc6b6cf6cce123b7f741317c20762
MD5 06d47f40e0ea82541cc8fa3d4d6b3adc
BLAKE2b-256 c0ad847ac91e9752a60efbb0f699bc76592dc813a5589bc028813af99ad207f7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyerrorhelper-0.2.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 18684512e838bfa6618e689b357b9b89100df78e659c223e9cb66ff87a4532f2
MD5 92df0c054aa4f331ad1c7bf91916fe46
BLAKE2b-256 ef029cda75a289b735026a6e899eab24979881bdb2b1295d0c6c9bd9cfc9e8e5

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