Browse docs

SDKs Python SDK

Python SDK

superflows for Python 3.9 and later. Standard library only.

Install

bash
1pip install superflows
python
1# first lines of your entry module, before importing the framework
2import superflows
3superflows.init(service="search-svc")

Frameworks

Flask, FastAPI / Starlette and Django are picked up automatically. Each gunicorn or uwsgi worker reports as its own instance. Under uvicorn and gunicorn a clean shutdown shows STOPPED.

API

CallWhat it does
superflows.init(service=None, env=None, key=None, release=None, endpoint=None)Starts Superflows. Never raises.
superflows.health(fn)Sync or async deep check, 2-second timeout. False or an exception → DEGRADED.
superflows.flush(timeout=2.0)Sends what is buffered. True when everything was sent.

Configuration

VariableMeaning
SUPERFLOWS_KEYIngest key (also read from .env). Required except against superflows dev.
SUPERFLOWS_ENDPOINTDefaults to https://ingest.superflows.cloud. Use http://localhost:4318 with superflows dev.
SUPERFLOWS_ENVEnvironment name; falls back to NODE_ENV / ENV, then production.
SUPERFLOWS_SERVICEService name; falls back to package.json / pyproject name, then the folder.
SUPERFLOWS_RELEASERelease version; the git SHA is detected from CI variables or .git.
SUPERFLOWS_DISABLED=1Turns the SDK into a no-op.
SUPERFLOWS_DEBUG=1Prints the SDK's own debug lines to stderr.