Skip to main content

Official FluxionDB Python client

Project description

FluxionDB Python Client

This package provides an officially supported Python interface to FluxionDB that mirrors the Node.js and Go SDKs. It wraps the WebSocket protocol (query-parameter authentication, typed message payloads, reconnect handling) and exposes the same record, collection, key/value, and API key management helpers.

Installation

cd clients/python
pip install .

For development:

pip install -e ".[dev]"

Usage

from fluxiondb_client import FluxionDBClient, ApiKeyScope

client = FluxionDBClient(
    url="ws://localhost:8080",
    api_key="YOUR_SECRET_KEY",
    connection_name="python-sdk",
)
client.connect()

now = int(time.time())
client.insert_multiple_records([
    {"ts": now, "doc": "device-1", "data": '{"temperature":22.5}', "col": "sensors"},
])
latest = client.fetch_latest_records({
    "col": "sensors",
    "ts": now,
    "doc": "/device-[12]/",
    "where": "state:flying",  # Optional: keep records containing this string
    "filter": "quality:bad",  # Optional: drop records containing this string
})
print(latest)

client.add_api_key("sensor-reader", ApiKeyScope.READ_ONLY)
client.remove_api_key("sensor-reader")
client.close()

Refer to fluxiondb_client/client.py for the full list of helpers, all of which map directly to the operations already available in the Go and Node clients.

Tests

cd clients/python
pytest

Or run against a real FluxionDB instance via Docker Compose (builds the server and test container):

docker compose up --build python-client

The tests expect FLUXIONDB_URL and FLUXIONDB_API_KEY; when using Compose these default to ws://fluxiondb:8080 and dev-secret. Set them manually if you are running the server yourself.

Publishing

Version bumps in pyproject.toml trigger the python-client-release GitHub Actions workflow when merged to main. The workflow installs the package, builds the wheel/sdist via python -m build, and uploads the artifacts to PyPI using the PYPI_API_TOKEN secret before tagging the release.

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

fluxiondb_client-0.2.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

fluxiondb_client-0.2.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file fluxiondb_client-0.2.0.tar.gz.

File metadata

  • Download URL: fluxiondb_client-0.2.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fluxiondb_client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0f7734710150177e6cedc926a80d324fe4421bfc5d1cc8b10faccef8d0e984b8
MD5 5814b6833251fd1001700d2a8beee26a
BLAKE2b-256 4d2fcc6be8d6f1f30eda503857d6503bef6f3018e4f5885dc9b9bd7fe8017458

See more details on using hashes here.

Provenance

The following attestation bundles were made for fluxiondb_client-0.2.0.tar.gz:

Publisher: python-client-release.yml on volandoo/FluxionDB

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

File details

Details for the file fluxiondb_client-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fluxiondb_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 689b2192515de824d08b4ff15642ab444b1a3020cee6bf6389ca7e6540522d1b
MD5 78409f9461813ee978d3195b22c88cfb
BLAKE2b-256 578b638609d7536a5889c75f7c419fb1b893f540c82158f17d6ad4349499f56f

See more details on using hashes here.

Provenance

The following attestation bundles were made for fluxiondb_client-0.2.0-py3-none-any.whl:

Publisher: python-client-release.yml on volandoo/FluxionDB

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

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