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
| Call | What 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
| Variable | Meaning |
|---|---|
SUPERFLOWS_KEY | Ingest key (also read from .env). Required except against superflows dev. |
SUPERFLOWS_ENDPOINT | Defaults to https://ingest.superflows.cloud. Use http://localhost:4318 with superflows dev. |
SUPERFLOWS_ENV | Environment name; falls back to NODE_ENV / ENV, then production. |
SUPERFLOWS_SERVICE | Service name; falls back to package.json / pyproject name, then the folder. |
SUPERFLOWS_RELEASE | Release version; the git SHA is detected from CI variables or .git. |
SUPERFLOWS_DISABLED=1 | Turns the SDK into a no-op. |
SUPERFLOWS_DEBUG=1 | Prints the SDK's own debug lines to stderr. |