Skip to main content

The official Python library for the Labric API

Project description

Labric Python SDK

The official Python library for the Labric API.

Installation

pip install labric

Usage

from labric import Labric

client = Labric()  # reads LABRIC_API_KEY from the environment
# or pass the API key explicitly: Labric(api_key="lbk_...")
# requests go to https://platform.labric.co by default; override with
# Labric(base_url="http://localhost:3000")

client.tools.write(
    target_name="samples",
    target_type="table",
    data=[{"sample_id": "S-001", "status": "received"}],
    mode="create",
)

An async client is also available:

from labric import AsyncLabric

See src/labric/reference.md for the full API reference.

Development

The code in src/labric/ is generated by Fern from the Labric OpenAPI spec — do not edit it by hand. The spec and Fern configuration live in the labric-web repository under sdk/; run make python-sdk there to regenerate the output into this repo. For local iteration only — released versions are regenerated in CI (see below).

Releasing

Releases are automated by the sync-python-sdk workflow in labric-web: when the OpenAPI spec or Fern config changes on its main, the workflow regenerates this repo, runs the tests, bumps the version, and pushes a v* tag. The tag triggers the release workflow here, which pauses for approval on the pypi environment — approve the deployment in the Actions tab to publish to PyPI via trusted publishing.

The bump defaults to patch. For a breaking change, include [bump:minor] (or [bump:major]) in the labric-web merge commit message, or run the workflow manually with the bump input.

To release manually (SDK-only fixes like README or packaging changes): bump version in pyproject.toml, merge to main, then tag:

git tag vX.Y.Z && git push origin vX.Y.Z

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

labric-0.8.1.tar.gz (70.5 kB view details)

Uploaded Source

Built Distribution

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

labric-0.8.1-py3-none-any.whl (64.3 kB view details)

Uploaded Python 3

File details

Details for the file labric-0.8.1.tar.gz.

File metadata

  • Download URL: labric-0.8.1.tar.gz
  • Upload date:
  • Size: 70.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for labric-0.8.1.tar.gz
Algorithm Hash digest
SHA256 23d939e488c5be04ad8083da353b5c69cdd75645c82ac07b9482ef91712989d5
MD5 88edeb4192aa164a1557250b31d3b56e
BLAKE2b-256 f111e8c859fefe46a508a649cb2f56f271f54d0a71134c1f51c0db50e02ced00

See more details on using hashes here.

Provenance

The following attestation bundles were made for labric-0.8.1.tar.gz:

Publisher: release.yml on Labric-Platforms/py-sdk

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

File details

Details for the file labric-0.8.1-py3-none-any.whl.

File metadata

  • Download URL: labric-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 64.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for labric-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7d2554411ea660e1e022636943b2b5f8c8bfac488b2655d40f7c5c6d8d33f2b4
MD5 a0a37bf34e154b800d7a9129af3a2381
BLAKE2b-256 0a425c238bd5d6d9a1797795faeff738432e1fbb7b85d3ab158ab31e5cc6a52f

See more details on using hashes here.

Provenance

The following attestation bundles were made for labric-0.8.1-py3-none-any.whl:

Publisher: release.yml on Labric-Platforms/py-sdk

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