Whisperr server-side SDK for Python — reliable churn-signal event tracking.
Project description
whisperr (Python)
The Whisperr server-side SDK for Python — reliable churn-signal event tracking for any Python backend. The backend is where the highest-signal churn events live (payment failures, cancellations, trial expiry, usage drops), so this is where Whisperr gets its most valuable signal.
pip install whisperr
Quick start
import os
from whisperr import Whisperr
whisperr = Whisperr(api_key=os.environ["WHISPERR_API_KEY"])
# A server-side churn signal:
whisperr.track("user_8842", "payment_failed", {"amount_cents": 4900, "reason": "card_declined"})
# Associate traits / contact channels with a user:
whisperr.identify("user_8842", email="ada@example.com", traits={"plan": "pro"})
# Deliver everything before the process exits:
whisperr.shutdown()
The user id (external_user_id) is always explicit here — unlike a browser
SDK, the server has no persisted session to infer it from. Pass the same id you
use everywhere else for that user, and frontend + backend events land on one
timeline automatically.
Design
- Same wire contract as the other Whisperr SDKs. Events post to
/v1/events/batch, identities to/v1/identify, authenticated withX-API-Key. - Non-blocking.
track()/identify()enqueue and return immediately; a background thread batches and delivers. Callflush()for a barrier. - Reliable in-process. In-memory queue, batching, retry with backoff
(429/5xx), malformed-4xx drop, per-event idempotency key. On
401/403or exhausted retries, delivery pauses and events stay buffered for the next flush rather than being dropped. The queue is not crash-durable — callflush()/shutdown()before exit (see Short-lived processes). - Process-friendly. A daemon thread that never blocks exit;
shutdown()is also registered viaatexit. - Zero runtime dependencies. Uses the standard library only.
Django
# settings.py
WHISPERR_API_KEY = os.environ["WHISPERR_API_KEY"]
MIDDLEWARE = [
# ... after your authentication middleware ...
"whisperr.django.WhisperrMiddleware",
]
# views.py
def upgrade(request):
request.whisperr.track("plan_upgraded", {"plan": "pro"})
...
request.whisperr.track() is bound to the request's authenticated user
(request.user.pk by default; override with WHISPERR_RESOLVE_USER, a dotted
path to def resolve(request) -> str | None). For events with no request —
Celery tasks, webhooks, management commands — use a client directly with the
user id from your domain data:
from whisperr.django import get_client
get_client().track(subscription.user_id, "subscription_cancelled", {"reason": reason})
Install the Django extra if you want the dependency pinned: pip install whisperr[django].
Short-lived processes
In scripts, serverless handlers, or management commands, call flush() (or
shutdown()) before exit so queued events aren't lost:
whisperr.track(user_id, "report_generated")
whisperr.flush()
Options
| Option | Default | Notes |
|---|---|---|
api_key |
— | App ingestion key (wrk_…). Required. |
base_url |
https://api.whisperr.net |
Ingestion base URL. |
flush_at |
20 |
Flush when this many events are queued. |
flush_interval |
10.0 |
Background flush cadence (seconds). |
max_queue_size |
10000 |
Oldest events drop on overflow. |
max_batch_size |
500 |
Events per batch (hard backend cap is 500). |
max_retries |
6 |
Consecutive retries before giving up a batch. |
request_timeout |
10.0 |
Per-request timeout (seconds). |
disabled |
False |
No-op client (useful in tests). |
debug |
False |
Verbose logging to stderr. |
on_error |
— | Callable[[WhisperrError], None] for observability. |
Whisperr — predict churn, automate interventions, recover revenue. whisperr.net
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file whisperr-0.1.1.tar.gz.
File metadata
- Download URL: whisperr-0.1.1.tar.gz
- Upload date:
- Size: 16.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e28bc67c9b7c6f5e975814b3e83695d2cd499279d296fe206bc9176ad316925f
|
|
| MD5 |
981661e5e4f3fd39dbd3b72ea49e91d6
|
|
| BLAKE2b-256 |
96b814f4b743a227b2667425aeafb907cde0a74d3bcaddce39e5b40f3d3a8303
|
Provenance
The following attestation bundles were made for whisperr-0.1.1.tar.gz:
Publisher:
publish.yml on WhisperrAI/whisperr-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
whisperr-0.1.1.tar.gz -
Subject digest:
e28bc67c9b7c6f5e975814b3e83695d2cd499279d296fe206bc9176ad316925f - Sigstore transparency entry: 1841315577
- Sigstore integration time:
-
Permalink:
WhisperrAI/whisperr-python@68d6037996d1bfad420bb4cfdf15b99e8f9a84b8 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/WhisperrAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@68d6037996d1bfad420bb4cfdf15b99e8f9a84b8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file whisperr-0.1.1-py3-none-any.whl.
File metadata
- Download URL: whisperr-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1599ca844b5f925d561e73d4226c098e0e03fb6dd1208031971c9cbbac047cd8
|
|
| MD5 |
52634a2f68d14763f5a4024d1a732de6
|
|
| BLAKE2b-256 |
dbe6270082c8fd1d56204ef6edfc1fa7527a07bfbb5c3b722ad23490eded69c4
|
Provenance
The following attestation bundles were made for whisperr-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on WhisperrAI/whisperr-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
whisperr-0.1.1-py3-none-any.whl -
Subject digest:
1599ca844b5f925d561e73d4226c098e0e03fb6dd1208031971c9cbbac047cd8 - Sigstore transparency entry: 1841316874
- Sigstore integration time:
-
Permalink:
WhisperrAI/whisperr-python@68d6037996d1bfad420bb4cfdf15b99e8f9a84b8 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/WhisperrAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@68d6037996d1bfad420bb4cfdf15b99e8f9a84b8 -
Trigger Event:
push
-
Statement type: