Skip to main content

Proliferate Error Monitoring SDK for Python

Project description

proliferate

Python SDK for Proliferate Error Monitoring.

Installation

pip install proliferate

Quick Start

import proliferate

# Initialize the SDK
proliferate.init(
    endpoint="https://your-api.com/api/v1/errors",
    api_key="pk_your_api_key",
    environment="production",
    release="1.0.0",
)

# Set user context (optional)
proliferate.set_user({
    "id": "user_123",
    "email": "user@example.com",
})

# Set account context (optional)
proliferate.set_account({
    "id": "acct_456",
    "name": "Acme Corp",
})

Automatic Error Capture

After initialization, the SDK automatically captures:

  • Uncaught exceptions (sys.excepthook)
  • Unhandled exceptions in threads (threading.excepthook)

Manual Error Capture

# Capture an exception
try:
    risky_operation()
except Exception as e:
    proliferate.capture_exception(e, extra={"order_id": "order_789"})

# Capture current exception (in except block)
try:
    another_operation()
except Exception:
    proliferate.capture_exception()  # Captures current exception

# Capture a message
proliferate.capture_message("User attempted invalid action", level="warning")

API

proliferate.init(endpoint, api_key, environment=None, release=None)

Initialize the SDK.

Parameter Type Required Description
endpoint str Yes API endpoint URL
api_key str Yes Project API key (format: pk_{project_slug}_{random})
environment str No Environment name
release str No Release version

API Key Notes:

  • API keys are project-scoped. Each project can have multiple API keys.
  • Keys follow the format pk_{project_slug}_{random_hex} (e.g., pk_my-app-default_a1b2c3d4e5f6)
  • Revoked keys will return a 401 Unauthorized error with message "API key has been revoked"
  • You can manage API keys from the dashboard under Project Settings > API Keys

proliferate.set_user(user)

Set user context for error reports.

proliferate.set_user({"id": "user_123", "email": "user@example.com"})
proliferate.set_user(None)  # Clear user context

proliferate.set_account(account)

Set account context for error reports.

proliferate.set_account({"id": "acct_456", "name": "Acme Corp"})
proliferate.set_account(None)  # Clear account context

proliferate.capture_exception(exception=None, extra=None)

Capture an exception.

try:
    risky_operation()
except Exception as e:
    proliferate.capture_exception(e, extra={"additional_data": "value"})

proliferate.capture_message(message, level="info", extra=None)

Capture a message.

proliferate.capture_message("Something happened", level="warning", extra={"context": "value"})

Thread Safety

The SDK uses thread-local storage for user and account context. Each thread maintains its own context, making it safe to use in multi-threaded applications.

import threading

def worker(user_id):
    # Each thread can have different context
    proliferate.set_user({"id": user_id})
    # ... do work ...

threads = [
    threading.Thread(target=worker, args=(f"user_{i}",))
    for i in range(10)
]
for t in threads:
    t.start()

Requirements

  • Python 3.10+
  • No external dependencies (uses stdlib only)

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

proliferate_ai-0.1.0.tar.gz (26.2 kB view details)

Uploaded Source

Built Distribution

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

proliferate_ai-0.1.0-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: proliferate_ai-0.1.0.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for proliferate_ai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d2c12b0fc4cd70282a4a0ff14d7d30a2b5db937c8954fedaa4c08a9ffd456894
MD5 a2c4c23fafa8ff45e384d7793cd833cc
BLAKE2b-256 123c234de3511c184f1fe9aa724f908c547999976b31ffc3994b2577bb9be491

See more details on using hashes here.

Provenance

The following attestation bundles were made for proliferate_ai-0.1.0.tar.gz:

Publisher: publish-pypi.yml on withkeystone/proliferation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: proliferate_ai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for proliferate_ai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3dd0821a90b7513118b4a6362063f13139a9fd3a2e069798be51b2e3580635cd
MD5 d51ed324df6b5cf34d155e5b709320ec
BLAKE2b-256 26bb16ed82391c7d20f05c23a6f0b2481f3cb58608ff81c57ea6b196d8e64f38

See more details on using hashes here.

Provenance

The following attestation bundles were made for proliferate_ai-0.1.0-py3-none-any.whl:

Publisher: publish-pypi.yml on withkeystone/proliferation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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