Metadata-Version: 2.4
Name: labric
Version: 0.8.5
Summary: The official Python library for the Labric API
Project-URL: Homepage, https://platform.labric.co
Project-URL: Repository, https://github.com/Labric-Platforms/py-sdk
Author: Labric
License-Expression: MIT
Requires-Python: >=3.9
Requires-Dist: httpx>=0.21.2
Requires-Dist: pydantic>=1.9.2
Requires-Dist: typing-extensions>=4.0.0
Description-Content-Type: text/markdown

# Labric Python SDK

The official Python library for the [Labric](https://labric.co) API.

## Installation

```bash
pip install labric
```

## Usage

```python
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:

```python
from labric import AsyncLabric
```

See [`src/labric/reference.md`](src/labric/reference.md) for the full API reference.

## Development

The code in `src/labric/` is generated by [Fern](https://buildwithfern.com) 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](https://pypi.org/project/labric/) 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:

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