Skip to main content

lab-link Python

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

Bind a reactive state model, 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, ReactiveModel

class AppState(ReactiveModel):
    voltage: float = 0.0

sync = LabSync()
state = sync.bind_state(AppState())

@sync.command
def set_voltage(value: float):
    state.voltage = round(value, 3)  # validated, batched, broadcast

app = sync.create_app()

Persistent remote access is available through LanPassphraseAuth and SQLiteAuthStore, including first-run setup, remembered devices, one-time invitations, session revocation, and scoped API tokens.

from lab_link import LabLinkClient

with LabLinkClient("ws://127.0.0.1:8000/sync/ws", api_token=token) as sync:
    snapshot = sync.snapshot()
    ack = sync.send_command("set_voltage", {"value": 1.2})

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

Metadata

Release files for lab-link 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lab-link 0.5.0
File Size Uploaded
lab_link-0.5.0.tar.gz 29.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lab-link 0.5.0
File Interpreter ABI Platform
lab_link-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 64.7 kB

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page