Last updated Nov 8, 2025

Python SDK

Track events from Django, FastAPI, or any Python service.

Installation

Install from the monorepo using pip so you can lock to a Git tag or commit.

pip install "git+https://github.com/fumi-ops/fumi.git#subdirectory=packages/sdk-python"

Send an event

from fumi import Fumi

client = Fumi(
    api_key="fumi_xxx",
    endpoint="https://your-worker.workers.dev",
)

client.track(
    name="user.signup",
    payload={"user_id": "123"},
    severity="info",
)

Deployment tips

  • Store the API key in your secrets manager; do not hardcode values.
  • Use background tasks (Celery, RQ) to buffer events if the API call must not block a request thread.
  • Provide context_id for grouping production vs. staging traffic, or omit it for ad-hoc streams.
  • Combine with the Playground to validate payload structure before rollout.