Install

Install on Python

Install the Sankofa Python SDK (sankofa-catch on PyPI). Server-side error tracking with WSGI and ASGI middlewares.

The Sankofa Python SDK is published to PyPI as sankofa-catch. Import it as sankofa_catch. It captures errors, breadcrumbs, transactions, and ships WSGI and ASGI middleware adapters for any Python web framework.

Requirements

  • Python 3.9+ (3.11+ recommended)
  • pip 22+

1. Install the package

bash
pip install sankofa-catch

2. Initialize at startup

Call sankofa_catch.init once, before any imports that may throw — typically the very first thing in wsgi.py, asgi.py, or your CLI entry point.

Pythonapp.py
import os
import sankofa_catch

sankofa_catch.init(
  api_key=os.environ["SANKOFA_KEY"],
  endpoint="https://api.sankofa.dev",
  release=os.environ.get("RELEASE_SHA"),
  environment=os.environ.get("ENV", "production"),
)

Common init options

api_keystrRequired
Your project's server-side API key.
endpointstrRequired
Server base URL.
releasestr
Commit SHA or version tag — used to group source-mapped errors.
environmentstrdefault production
Free-form label (development, staging, production).
app_versionstr
Your app's user-facing version string.
traces_sample_ratefloatdefault 0.1
Distributed-tracing sample rate (0.0–1.0).
autocapture_consolebooldefault True
Capture print() / logging.error as breadcrumbs.
capture_unhandledbooldefault True
Auto-capture sys.excepthook.

3. Wire your framework

Pythonapp.py
import os
from flask import Flask
import sankofa_catch
from sankofa_catch.wsgi import SankofaWSGI

sankofa_catch.init(api_key=os.environ["SANKOFA_KEY"], endpoint="https://api.sankofa.dev")

app = Flask(__name__)
app.wsgi_app = SankofaWSGI(app.wsgi_app)

@app.route("/")
def home():
  return "ok"

4. Verify the install

Python
sankofa_catch.capture_message("install_check")

Open app.sankofa.devLive events. The message should appear with a python source label and the interpreter version captured under default properties.

What's next

Edit this page on GitHub