Skip to main content

Generic server-authoritative sync library for FastAPI

Project description

lab-link Python

FastAPI/Pydantic backend runtime and Python sync client for lab-link.

Use it to register authoritative state, expose a WebSocket sync endpoint, run commands with hardware side effects, broadcast versioned JSON Patch updates, or control a lab-link server from Python.

uv add lab-link
from lab_link import LabSync

sync = LabSync()
sync.register_state(AppState, initial=state)
app = sync.create_app()
from lab_link import LabLinkClient

with LabLinkClient("ws://127.0.0.1:8000/sync/ws") as sync:
    snapshot = sync.snapshot()
    ack = sync.send_command("set_voltage", {"path": "/channels/0/bias_voltage", "value": 1.2})

Full docs: https://sansseriff.github.io/lab-link/

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

lab_link-0.2.0.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

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

lab_link-0.2.0-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

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