Lablink API reference
The reference for the pypalmsens.lablink module: connecting to Lablink instances, claiming instruments, running measurements, and fetching data. All methods that talk to the server are async. See the lablink introduction for how to get started and concepts for the object model.
Functions
discover– Discover lablink instances on the network
Classes
Instance– Lablink instance: address plus cached metadataSession– Authenticated Lablink connectionInstrument– Reference to an attached instrumentInstrumentClaim– Exclusive claim on an instrumentInstrumentClaimBatch– Group of instrument claimsMeasurement– Reference to a stored measurementMeasurementJob– Handle to an active measurement
Exceptions
LablinkApiError– Base class for API errorsNoActiveMeasurementError– No active measurementLablinkClientError– Client errors (4xx)LablinkServerError– Server errors (5xx)
pypalmsens.lablink.discover
async
Browse the local network for LabLink devices for a fixed duration.
Uses zeroconf to browse for the _lablink._tcp.local. service type.
Each discovered device is resolved into a dictionary of properties
(hostname, addresses, TXT record fields) and appended to the results list.
Parameters:
-
(ip_versionIPVersion, default:All) –IP protocol version for browsing/name resolution. Defaults to
zeroconf.IPVersion.All. -
(timeoutfloat, default:10) –How many seconds to browse before stopping. Default is 10.
Returns:
-
list[dict]–One dictionary per discovered LabLink device. Each dict contains:
- server: fully qualified host name (e.g. "lablink-01.local.")
- addresses: parsed scoped IP address strings
- other TXT record fields as-is, e.g. name, serial, version
The list is empty if no devices are discovered within the timeout.
Examples:
>>> import asyncio
>>> devices = asyncio.run(discover(timeout=10))
>>> device, _* = devices
>>> devices["name"]
'lablink-01'
>>> devices["addresses"]
['192.168.1.42', ...]
Source code in src/pypalmsens/lablink/_discover.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | |