The official Python library for the Labric API
Actively maintained. Last release 1 day ago, commits in 21 of the last 26 weeks. A safe choice.
$
pip install labricREADME as published on PyPI with version 0.19.6.
Labric Python SDK
The official Python library for the Labric API. Full documentation is available at docs.labric.co.
Installation
pip install labric
Usage
from labric import Labric, SeriesWrite, TableWrite
client = Labric() # reads LABRIC_API_KEY from the environment
# or pass the API key explicitly: Labric(api_key="lbk_...")
client.data.write(
tables=[
TableWrite(
table="samples",
rows=[{"_ref": "s1", "name": "S-001", "status": "received"}],
),
],
series=[
SeriesWrite(
table="spectra",
parent="@s1",
columns={"wavelength": [400, 500, 600], "absorbance": [0.12, 0.34, 0.21]},
),
],
)
An async client is also available:
from labric import AsyncLabric
See the API reference for the full list of methods and types.
Support
Contributing
This SDK is largely generated code. See CONTRIBUTING.md for how it is generated and released.