Skip to main content

Async Python library to discover and manage lab devices (pump, valve, densitometer).

Project description

lab_devices

CI PyPI version

Async Python library to discover and manage lab devices — peristaltic pumps, distribution valves, and densitometers — over the SerialHop / lab-bridge API.

Install

pip install bioexperiment-lab-devices    # import as: import lab_devices

For development (runtime + dev deps):

poetry install --all-extras
# or, without Poetry:
pip install -e ".[dev]"

Core usage (host + port)

import asyncio
from lab_devices import LabClient

async def main():
    async with LabClient("chisel", 8089) as lab:
        pump = lab.pump(1)
        job = await pump.dispense(volume_ml=10, speed_ml_min=3.0)
        result = await job.result()
        print(result.dispensed_ml)

asyncio.run(main())

Server-only discovery (inside labnet)

from lab_devices.discovery import LabRegistry

async with LabRegistry() as reg:            # LAB_DEVICES_DISCOVERY_URL overrides the endpoint
    print(await reg.list_labs())
    lab = await reg.connect("khamit_desktop")
    async with lab:
        await lab.densitometer(1).measure()

Discovery uses the internal, unauthenticated roster endpoint and needs no token. It only works from inside the lab-bridge network.

Development

poetry run pytest        # hermetic; no hardware needed
poetry run mypy
poetry run ruff check .

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

bioexperiment_lab_devices-0.1.1.tar.gz (42.9 kB view details)

Uploaded Source

Built Distribution

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

bioexperiment_lab_devices-0.1.1-py3-none-any.whl (59.5 kB view details)

Uploaded Python 3

File details

Details for the file bioexperiment_lab_devices-0.1.1.tar.gz.

File metadata

File hashes

Hashes for bioexperiment_lab_devices-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ca92ea9c3563f33b80c239758ca605deb3feeeb60f32b1c67dcc41d50ee05404
MD5 c015edc66d206a32980079b49146bb28
BLAKE2b-256 396308270e0c2d25f6238b4e040612c4d471576206ef9a7deed39291bb555a87

See more details on using hashes here.

Provenance

The following attestation bundles were made for bioexperiment_lab_devices-0.1.1.tar.gz:

Publisher: release-please.yml on bioexperiment-lab-devices/lab-devices

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bioexperiment_lab_devices-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for bioexperiment_lab_devices-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 643a77d87926446d58d1c7ff28f826ca9737295f7730970fc2fb91a3f0c83415
MD5 cc55ec149332ff45758e9a94f1c3d211
BLAKE2b-256 5293da619c6750b60e518f3ba85c6daf49c06890ba887501e59054355a199150

See more details on using hashes here.

Provenance

The following attestation bundles were made for bioexperiment_lab_devices-0.1.1-py3-none-any.whl:

Publisher: release-please.yml on bioexperiment-lab-devices/lab-devices

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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