Thin Python SDK for Plexus — send telemetry in one line
Project description
plexus-python
Thin Python SDK for Plexus. Send telemetry to the Plexus gateway in one line. Storage, dashboards, alerts, and fleet management live in the platform — this package just ships your data.
Quick Start
pip install plexus-python
from plexus import Plexus
px = Plexus(api_key="plx_xxx", source_id="device-001")
px.send("temperature", 72.5)
Get an API key at app.plexus.company → Devices → Add Device.
Usage
from plexus import Plexus
px = Plexus(source_id="rig-01") # reads PLEXUS_API_KEY from env
# Numbers
px.send("engine.rpm", 3450)
px.send("coolant.temperature", 82.3, tags={"unit": "C"})
# Strings, bools, objects, arrays — all JSON-serializable
px.send("vehicle.state", "RUNNING")
px.send("motor.enabled", True)
px.send("position", {"x": 1.5, "y": 2.3, "z": 0.8})
# Batch
px.send_batch([
("temperature", 72.5),
("pressure", 1013.25),
])
# Named run for grouping related data
with px.run("thermal-cycle-001"):
while running:
px.send("temperature", read_temp())
Bring Your Own Protocol
This package ships no adapters, auto-detection, or daemons — just the client. Use whatever library you'd use anyway and pipe values into px.send().
# MAVLink (pymavlink)
for msg in conn:
if msg.get_type() == "ATTITUDE":
px.send("attitude.roll", msg.roll)
# CAN (python-can)
for msg in bus:
px.send(f"can.0x{msg.arbitration_id:x}", int.from_bytes(msg.data, "big"))
# MQTT (paho-mqtt)
def on_message(_c, _u, msg):
px.send(msg.topic.replace("/", "."), float(msg.payload))
# I2C sensor (Adafruit CircuitPython)
px.send("temperature", bme.temperature)
See examples/ for runnable versions of each.
Reliability
Every send buffers locally before hitting the network, retries with exponential backoff, and keeps your data safe across outages. Enable SQLite persistence to survive restarts and power loss:
px = Plexus(persistent_buffer=True)
Point counts and flush:
px.buffer_size()
px.flush_buffer()
Environment Variables
| Variable | Description | Default |
|---|---|---|
PLEXUS_API_KEY |
API key (required) | none |
PLEXUS_GATEWAY_URL |
HTTP ingest URL | https://plexus-gateway.fly.dev |
PLEXUS_GATEWAY_WS_URL |
WebSocket URL (unused in SDK, for compatibility) | wss://plexus-gateway.fly.dev |
Architecture
Your code ── px.send() ── HTTP POST /ingest ──> plexus-gateway ──> ClickHouse + Dashboard
One thin path. No agent, no daemon, no adapters. If you want the full HardwareOps platform — dashboards, alerts, RCA, fleet views — that's the web UI at app.plexus.company. This package gets your data there.
License
Apache 2.0
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 plexus_python-0.2.0.tar.gz.
File metadata
- Download URL: plexus_python-0.2.0.tar.gz
- Upload date:
- Size: 32.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
983884d5ad7b93d3e1a9314ff57fffdef2672b85c35fce6468b13a181fc6268c
|
|
| MD5 |
cae16ed6fdafd568d714d0de578ee73c
|
|
| BLAKE2b-256 |
468d65c3aa086068795d37c94156c47e5a8e653fb1f939c52827096395d4bf39
|
Provenance
The following attestation bundles were made for plexus_python-0.2.0.tar.gz:
Publisher:
publish.yml on plexus-oss/plexus-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
plexus_python-0.2.0.tar.gz -
Subject digest:
983884d5ad7b93d3e1a9314ff57fffdef2672b85c35fce6468b13a181fc6268c - Sigstore transparency entry: 1280989032
- Sigstore integration time:
-
Permalink:
plexus-oss/plexus-python@be10267d4d85b3b39b7bfc0e62797f78f99402d2 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/plexus-oss
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@be10267d4d85b3b39b7bfc0e62797f78f99402d2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file plexus_python-0.2.0-py3-none-any.whl.
File metadata
- Download URL: plexus_python-0.2.0-py3-none-any.whl
- Upload date:
- Size: 16.4 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 |
fa1cee7d2d65f8904f58f8e9f45f7b0fee73eb238fddb2319a9cfe98356906a2
|
|
| MD5 |
813812cd4817548d88bc61bbc5389b0f
|
|
| BLAKE2b-256 |
05844d10d230735e56d883eedb4b08d5267c5a51fd3843af88d14a65506b8004
|
Provenance
The following attestation bundles were made for plexus_python-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on plexus-oss/plexus-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
plexus_python-0.2.0-py3-none-any.whl -
Subject digest:
fa1cee7d2d65f8904f58f8e9f45f7b0fee73eb238fddb2319a9cfe98356906a2 - Sigstore transparency entry: 1280989041
- Sigstore integration time:
-
Permalink:
plexus-oss/plexus-python@be10267d4d85b3b39b7bfc0e62797f78f99402d2 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/plexus-oss
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@be10267d4d85b3b39b7bfc0e62797f78f99402d2 -
Trigger Event:
release
-
Statement type: