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.3.0.tar.gz (43.4 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.3.0-py3-none-any.whl (60.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for bioexperiment_lab_devices-0.3.0.tar.gz
Algorithm Hash digest
SHA256 7910b85170618863ac71b59e20ead38ed0fd5f52171ec2f702714f10a59249d1
MD5 19d8a6d0f81c8d8ea332792d6d069299
BLAKE2b-256 aab49d871b77156974993c714b2ebea34d0dadaa12a201b96553e2e7002476fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for bioexperiment_lab_devices-0.3.0.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.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bioexperiment_lab_devices-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 50b95d878d8ec4baa9fa4d8cc4ebb733990e557e4ad6c86b4c5492ea49e6ac11
MD5 122c2fc3be40884c85734b44dcc84074
BLAKE2b-256 8c742f882879d13cf7a641f6fca08f90e7ce1c187c11e8166d711b26b8503c5b

See more details on using hashes here.

Provenance

The following attestation bundles were made for bioexperiment_lab_devices-0.3.0-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