Skip to main content

Python Server SDK

Backend event tracking for Python: background batching, retries with backoff and jitter, automatic UUIDv7 idempotency keys. Standard library only; Python ≥ 3.9.

Usage

from hober import HoberClient

client = HoberClient(os.environ["HOBER_SERVER_KEY"])

client.track(
"order.placed",
external_id="user-483", # your user id — resolved by Hober's registry
properties={"order_id": "ord_921", "total_cents": 12900},
)

client.identify("anon-9f2c", subscriber_uuid)
client.close() # flush before process exit

Create the server key under Settings → Server Keys. Full API semantics: Server-Side Event Tracking.

Behavior

  • Batching: a background thread ships batches of 100 (max_batch_size) or every 5s (flush_interval); flush()/close() drain. The queue holds 10k events; beyond that track raises rather than growing unbounded.
  • Retries: 429 (honoring Retry-After) and 5xx retry with exponential backoff + jitter (4 retries default); other 4xx are permanent and surface through on_error (default: dropped silently — tracking never takes your process down).
  • Idempotency: every event gets a UUIDv7 key unless you set one; supply your own (outbox row id, order id) to make cross-process retries safe.