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]/")
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.1.0.tar.gz (8.5 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.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fluxiondb_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 823d16a298c0fc38fc5e16e04eebc63f71d2831d520c30508168ce9a9d41bacd
MD5 437010484a7c2e40c9978dacaf0ae8bf
BLAKE2b-256 d6895e6d6ddd51ff98fa8bf58dde02c1ede04cacb2d70b2ec81dc90b56a1b3c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for fluxiondb_client-0.1.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.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fluxiondb_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef816cc6e6a76f00d56c0f0401dd8dde9aa3fd08a9fbb621caad73c9a9914869
MD5 1bca12f429fef84a52811d297cd306f2
BLAKE2b-256 d51a4b19724475f5b36a0ad93cd10b1ce87318c3d2f8029a0431eb412419d459

See more details on using hashes here.

Provenance

The following attestation bundles were made for fluxiondb_client-0.1.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