Skip to main content

OpenExcept

OpenExcept is an intelligent exception grouping library that uses machine learning to automatically categorize and group similar exceptions without manual rules.

Features

  • 🤖 Automatic exception grouping using ML - no manual rules needed
  • 🎯 Groups similar exceptions together based on semantic meaning
  • 🔌 Easy integration with existing logging systems
  • 🚀 Simple API for getting started quickly
  • 🐳 Docker support for easy deployment

Installation

pip install openexcept

Quick Start

Docker Setup

To use OpenExcept with Docker:

  1. Clone the repository:

    git clone https://github.com/OpenExcept/openexcept.git
    cd openexcept
    
  2. Build and start the Docker containers:

    docker-compose up -d
    

    This will start two containers:

    • OpenExcept API server on port 8000
    • Qdrant vector database on port 6333
  3. Install local dependencies

pip install -e .
  1. You can now use the OpenExcept API at http://localhost:8000 You can now use it with an example as python examples/basic_usage.py

Basic Usage

from openexcept import OpenExcept

grouper = OpenExcept()

exceptions = [
    "Connection refused to database xyz123",
    "Connection refused to database abc987",
    "Divide by zero error in calculate_average()",
    "Index out of range in process_list()",
    "Connection timeout to service endpoint",
]

for exception in exceptions:
    group_id = grouper.group_exception(exception)

# When we get the top 1 exception group, it should return the group
# that contains "Connection refused to database xyz123" since it occurs the most
top_exception_groups = grouper.get_top_exception_groups(1)

Integrating with Existing Logger

You can easily integrate OpenExcept with your existing logging setup using the provided OpenExceptHandler:

import logging
from openexcept.handlers import OpenExceptHandler

# Set up logging
logger = logging.getLogger(__name__)
logger.addHandler(OpenExceptHandler())

# Now, when you log an error, it will be automatically grouped
try:
    1 / 0
except ZeroDivisionError as e:
    logger.error("An error occurred", exc_info=True)

This will automatically group exceptions and add the group ID to the log message.

For more detailed examples, check the examples/logger_integration.py in the project repository.

Documentation

For more detailed information, check out our API Documentation.

Contributing

We welcome contributions! Please see our Contributing Guide for more details.

License

This project is licensed under the AGPLv3 License - see the LICENSE file for details.

Release files for openexcept 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openexcept 0.1.0
File Size Uploaded
openexcept-0.1.0.tar.gz 32.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openexcept 0.1.0
File Interpreter ABI Platform
openexcept-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 60.0 kB

Release files / openexcept-0.1.0.tar.gz

Download URL openexcept-0.1.0.tar.gz
Size 32.3 kB
Tags Source
SHA-256 checksum
How to use checksums
cb379b8280361f08f8fc186bc437b1a1d6cb0acf8f540a932ec17b5e314a43c5
BLAKE2b-256 checksum
How to use checksums
18017e3fb4f7711fb602bfd98c34e3302aa06c7accd5ab789b3de911a5b55df7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Release files / openexcept-0.1.0-py3-none-any.whl

Download URL openexcept-0.1.0-py3-none-any.whl
Size 27.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db59786fb8b98b46d382e9baef5d7556617d0f6fd814285ae6e62e1042086079
BLAKE2b-256 checksum
How to use checksums
055267511dad0ee998af08fa557e327424c6a0409d5ef7aa2777a3252af0f785
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page