Skip to main content

GetFluxly Python SDK — server-side events, identify, alias, with batching, retries, and idempotency.

Project description

getfluxly (Python)

Server-side Python SDK for GetFluxly. Same surface as the Node SDK so observability across SDKs lives in one mental model.

pip install getfluxly

Quick start (sync)

from getfluxly import Client

client = Client(token="gflux_secret_yourtoken")

client.track("subscription_started",
             external_id="user_42",
             properties={"plan": "pro"})

client.identify(external_id="user_42",
                traits={"email": "x@y.com", "plan": "pro"})

client.alias(user_id="user_42", anonymous_id="anon_a8f3c2")

client.flush()
client.shutdown()  # also runs from atexit

Quick start (async)

from getfluxly import AsyncClient

async with AsyncClient(token="gflux_secret_yourtoken") as ac:
    await ac.track("subscription_started",
                   external_id="user_42",
                   properties={"plan": "pro"})

Defaults

Option Default Notes
flush_at 20 Events queued before forced flush
flush_interval 5.0 Periodic flush cadence, seconds
max_retries 2 Per failed batch
timeout 5.0 Per HTTP request, seconds
max_queue_size 1000 Hard cap, raises queue_overflow

Retries: 408, 425, 429, and 5xx with exponential backoff and +/- 25% jitter. Retry-After is honored. Each batch carries a unique X-Idempotency-Key.

Errors

from getfluxly import GFluxError

try:
    client.track("invoice_paid", external_id="user_42")
except GFluxError as e:
    if e.code == "queue_overflow":
        ...  # back-pressure
    elif e.retryable:
        ...  # SDK already retried max_retries times

Full code table at docs.getfluxly.com/snippets/error-table.

Server keys never in browser

Client(token="gflux_secret_...") refuses to construct if it detects a Pyodide / Emscripten runtime, so a server-side script that accidentally ships to the browser fails loudly instead of leaking the key into client traffic.

License

MIT, see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

getfluxly-0.1.0.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

getfluxly-0.1.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file getfluxly-0.1.0.tar.gz.

File metadata

  • Download URL: getfluxly-0.1.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for getfluxly-0.1.0.tar.gz
Algorithm Hash digest
SHA256 56052445f5a6b6d56c1793e268ac701da8413886f0b522b95a0ffefde34c0518
MD5 54dbc3d43d6498add6f45517cce12e9d
BLAKE2b-256 6ae6cdda2fe3fffb5284ebb2596f39b4d2c354a78ee0efc2c244f7292b7e7861

See more details on using hashes here.

File details

Details for the file getfluxly-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: getfluxly-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for getfluxly-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9ca5f253289850f7d8c934f38cf8defcdfe888e4018d006f474583775956c91
MD5 8868feb8f7b17647b4abdb32edc214a6
BLAKE2b-256 8909082d817380df1ba841954b598bcd4990f4e9ebbd74c04c10dec75fb9fb6e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page