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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyerrorhelper-0.2.3.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.3.tar.gz
Algorithm Hash digest
SHA256 eae94432590beae5aaf424fc60a68454fe526e3565c1410a1b66b18bcc1ac5d2
MD5 01bb61090b3c2b7a6e5d7f934c74bd03
BLAKE2b-256 d9018570f9d829b33e1f69d4df182aa5f1d9e5a918c24ae6b151a14a27848162

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyerrorhelper-0.2.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3e6d81b77e73093c46b82b8bfeb6e8e789e791e40bd87cddeb73aebfd689682a
MD5 d4442a6f1d596d476adefd8b78404b56
BLAKE2b-256 5cb908777d33f5b81ebfc71e5181b8347daa75a8aeec708b407fdac8e46a6bec

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