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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f7734710150177e6cedc926a80d324fe4421bfc5d1cc8b10faccef8d0e984b8
|
|
| MD5 |
5814b6833251fd1001700d2a8beee26a
|
|
| BLAKE2b-256 |
4d2fcc6be8d6f1f30eda503857d6503bef6f3018e4f5885dc9b9bd7fe8017458
|
Provenance
The following attestation bundles were made for fluxiondb_client-0.2.0.tar.gz:
Publisher:
python-client-release.yml on volandoo/FluxionDB
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fluxiondb_client-0.2.0.tar.gz -
Subject digest:
0f7734710150177e6cedc926a80d324fe4421bfc5d1cc8b10faccef8d0e984b8 - Sigstore transparency entry: 1469294966
- Sigstore integration time:
-
Permalink:
volandoo/FluxionDB@512944f1f6a61d436fdef80bf754ff495a866f18 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/volandoo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-client-release.yml@512944f1f6a61d436fdef80bf754ff495a866f18 -
Trigger Event:
push
-
Statement type:
File details
Details for the file fluxiondb_client-0.2.0-py3-none-any.whl.
File metadata
- Download URL: fluxiondb_client-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
689b2192515de824d08b4ff15642ab444b1a3020cee6bf6389ca7e6540522d1b
|
|
| MD5 |
78409f9461813ee978d3195b22c88cfb
|
|
| BLAKE2b-256 |
578b638609d7536a5889c75f7c419fb1b893f540c82158f17d6ad4349499f56f
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fluxiondb_client-0.2.0-py3-none-any.whl -
Subject digest:
689b2192515de824d08b4ff15642ab444b1a3020cee6bf6389ca7e6540522d1b - Sigstore transparency entry: 1469295205
- Sigstore integration time:
-
Permalink:
volandoo/FluxionDB@512944f1f6a61d436fdef80bf754ff495a866f18 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/volandoo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-client-release.yml@512944f1f6a61d436fdef80bf754ff495a866f18 -
Trigger Event:
push
-
Statement type: