Skip to content
BioLMPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

lltp-py

Python reference SDK for LLTP (Lab-in-the-Loop Transport Protocol) v0.1.

Primary audience: authors of {provider}-lltp connectors (and similar consumables). Agents and design tools typically talk to those connectors, not this SDK directly — though nothing prevents using the client helpers that way.

Maintained by BioLM during protocol kickoff. See the spec repo GOVERNANCE.md for long-term stewardship intent.

Status: v0.1-alpha. Message signing (sign / verify) is not yet implemented.

Install

pip install lltp

For local development:

pip install -e ".[dev]"

Requires Python >=3.8.

Quick start

from lltp import validate_envelope, derive_order_status
from lltp.client import LLTPClient
import json

with open("tests/fixtures/scenario-a-dna-synthesis/01-order.json") as f:
    order = json.load(f)

validate_envelope(order)
print(derive_order_status(order["requirements"]))  # IN_PROGRESS

Mock provider (Scenario A)

pip install -e .
python scripts/mock_provider.py --port 8765

In another shell:

from lltp.client import LLTPClient
import json

with open("tests/fixtures/scenario-a-dna-synthesis/01-order.json") as f:
    order = json.load(f)

with LLTPClient() as client:
    catalog = client.fetch_catalog("http://127.0.0.1:8765")
    summary = client.submit_order("http://127.0.0.1:8765", order)
    print(summary)

API overview

Module Purpose
lltp.validate validate_envelope, validate_catalog (JSON Schema)
lltp.lifecycle derive_order_status, merge_requirements
lltp.client LLTPClient — HTTP client for provider endpoints
lltp.webhook WebhookHandler — merge STATUS/RESULT deltas

Tests

pip install -e ".[dev]"
pytest

Refreshing vendored schemas and fixtures

When the spec repo changes:

cp ../lltp/schema/0.1/{envelope,provider}.schema.json src/lltp/schemas/
cp ../lltp/examples/catalog/twist.json tests/fixtures/catalog/
cp ../lltp/examples/scenario-a-dna-synthesis/*.json tests/fixtures/scenario-a-dna-synthesis/

Conformance

See CONFORMANCE.md for what this alpha SDK implements vs deferred.

Related repositories

  • lltp — protocol specification
  • BioLM/lltp-js — JavaScript/TypeScript reference SDK
  • {provider}-lltp — provider connectors (separate repos; e.g. twist-lltp) that use this SDK

License

Apache-2.0. See LICENSE.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages