Skip to main content

Fluxum Python SDK

The asyncio-first Python client for the Fluxum realtime database (SPEC-011, T7.4). Zero runtime dependencies — the SDK carries its own minimal MessagePack codec and FluxBIN row reader.

pip install fluxum-sdk
import asyncio
from fluxum import Connection, TableSchema

async def main():
    db = await Connection.connect(
        "fluxum://127.0.0.1:15801",
        token=b"my-token",
        tables=[...],  # from `fluxum generate --lang python`
    )
    await db.subscribe(["SELECT * FROM ChatMessage"])
    await db.call_reducer("send_chat", [1, "hello"])
    # TxUpdates land in db.cache; poll or read db.cache.rows("ChatMessage").
    await db.close()

asyncio.run(main())

What you get

  • Connection — one asyncio session over FluxRPC/TCP: authenticate, subscribe (each query's InitialData populates a local row cache), call reducers, and receive TxUpdate diffs on the same socket.
  • Transparent reconnect (SDK-047): on connection loss the client reconnects, re-authenticates, resubscribes every active query and reconciles its cache — the application keeps its handle across the outage.
  • A per-table row cache keyed by primary key, with per-query ownership so an unsubscribe drops only the rows that query held (SDK-044).
  • Full type hints (py.typed, SDK-062).

Typed bindings

Generate typed row classes and reducer wrappers from a running server's schema (or a saved schema.json):

fluxum generate --lang python --schema http://127.0.0.1:15800 --out ./gen

This emits tables.py (a @dataclass row + decoder + cache hooks per table), reducers.py (a typed async def per client-callable reducer), __init__.py, and py.typed. Offline generation from a saved schema produces byte-identical output (SPEC-011 acceptance 11).

Testing

The SDK is validated by the shared conformance corpus (tests/conformance/) — the same declarative scenarios every Fluxum SDK runs against the same server build (TST-052). The runner boots a fresh fluxum-server per scenario, so build it first:

cargo build -p fluxum-server
cd sdks/python && python -m pytest -q

Download files

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

Source Distribution

fluxum_sdk-0.3.0.tar.gz (22.5 kB view details)

Uploaded Source

Built Distribution

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

fluxum_sdk-0.3.0-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file fluxum_sdk-0.3.0.tar.gz.

File metadata

  • Download URL: fluxum_sdk-0.3.0.tar.gz
  • Upload date:
  • Size: 22.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for fluxum_sdk-0.3.0.tar.gz
Algorithm Hash digest
SHA256 ffabd1e2ef7855cd975f24cf58615f4236ce1ee70a52997171ac8a31bef04c53
MD5 dc218861d5bc843e7f1de2a0c7ece772
BLAKE2b-256 b82adabc740392fb6a573f119fd46d0dcbebc22473ae22b038c33d30a7993688

See more details on using hashes here.

Provenance

The following attestation bundles were made for fluxum_sdk-0.3.0.tar.gz:

Publisher: sdk-publish.yml on hivellm/fluxum

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fluxum_sdk-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: fluxum_sdk-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for fluxum_sdk-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 71322c8ea98d515ed88c546cf88821088e6e7e2ef9d197ca0d68d1da36780625
MD5 491bad371c130b6c1ebc7df3760bf7a7
BLAKE2b-256 c418beb01c89f9534727f56bcf1829972936835cb659fa3494e83923aa2a3e52

See more details on using hashes here.

Provenance

The following attestation bundles were made for fluxum_sdk-0.3.0-py3-none-any.whl:

Publisher: sdk-publish.yml on hivellm/fluxum

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 files

0.2.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page