Skip to main content

NZR Autofix SDK — capture errors and send to NZR Manager for AI-powered diagnosis and auto-fix

Project description

NZR Autofix Python SDK

Capture Python exceptions and send them to NZR Manager for AI-powered diagnosis and auto-fix.

Installation

pip install nzr-autofix

Quick Start

import nzr_autofix

nzr_autofix.init(dsn="https://your-server.com/api/autofix/ingest/")

# Unhandled exceptions are captured automatically via sys.excepthook

Django Integration

Add the middleware to automatically capture all unhandled view exceptions and 500 errors:

# settings.py
MIDDLEWARE = [
    'nzr_autofix.integrations.django.AutofixMiddleware',
    # ...other middleware
]

The middleware also connects to Django's got_request_exception signal to capture all 500 responses.

Celery Integration

Capture Celery task failures:

# celery.py
from nzr_autofix.integrations.django import setup_celery_hooks
setup_celery_hooks()

Manual Capture

try:
    risky_operation()
except Exception as e:
    nzr_autofix.capture_exception(e)

# Or capture a message
nzr_autofix.capture_message("Something unexpected happened")

Configuration

nzr_autofix.init(
    dsn="https://your-server.com/api/autofix/ingest/",
    environment="production",
    release="1.2.3",
    capture_locals=True,
    sanitize_patterns=["password", "secret", "token"],
    before_send=lambda event: event,  # return None to drop
)

License

MIT

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

nzr_autofix-0.1.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

nzr_autofix-0.1.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file nzr_autofix-0.1.0.tar.gz.

File metadata

  • Download URL: nzr_autofix-0.1.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for nzr_autofix-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fb7a2149d725195160392c79847c7ab3aee7be4dc6842f66222a6ffc2e87df34
MD5 29e0189eb37ae0b58201aa7a6bb28fab
BLAKE2b-256 ed3544e3940c0e7ce450906828e0de1da1028cdb1d8966abc4aab39abf403efc

See more details on using hashes here.

File details

Details for the file nzr_autofix-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nzr_autofix-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for nzr_autofix-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0be67d9790992598273345bec55b7e4a79db8c0689ac8f21bc5da76d5933c90
MD5 3fbd6cce19ac17a5b4736b2b93931e1f
BLAKE2b-256 e670f447f998b7e6cdd8bcb77f052cff1ad19eef01609031e25763224e8910ea

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