Skip to main content

Culsma

PyPI Python versions Release check bioRxiv Software DOI Reference DOI License

Culsma is the public reference implementation of the current Culsma language and execution stack. The public release is distributed as a Python-based CLI.

The executable core is organized in:

  • src/culsma/parser/
  • src/culsma/pipeline/
  • src/culsma/runtime/
  • src/culsma/driver/
  • src/culsma/stdlib/
  • tests/

The repository also maintains the Patterns benchmark cases and reproduction tools under benchmarks/, separate from the language implementation and its PyPI package. This is the canonical maintenance location for the paper's cases. The Culsma 1.0.9 evaluation covers 173/173 source steps; inputs and results are retained by version. The paper's fixed evaluation remains available in the v1.0.7 source release.

It intentionally leaves out full manuscript sources, MCP tooling, editor integrations, and internal design-workspace documents.

Install

For the current public release, install from PyPI:

python -m pip install culsma

You can also install directly from the v1.0.11 tag:

python -m pip install "culsma @ git+https://github.com/culsma/culsma.git@v1.0.11"

Version 1.0.11 adds environment media, component-aware fractionation, shared magnetic separation, external driver lifecycle support, and a unified benchmark reproduction command.

Release notes are in CHANGELOG.md.

The public language reference is maintained in the companion culsma-reference repository/worktree.

VS Code Support

Install Culsma Language Support from the Visual Studio Code Marketplace for syntax highlighting and editor language configuration. The extension binds canonical .culs files and retains .lw association during the transition from LabWord naming. Its source and VSIX releases are maintained in the culsma-vscode repository.

Repository Layout

src/culsma/parser/    grammar, AST, and source loading
src/culsma/pipeline/  compile, validate, typecheck, and plan lowering
src/culsma/runtime/   execution state, events, and material compute
src/culsma/driver/    backend boundary and concrete drivers
src/culsma/stdlib/    bundled standard-library source
tests/                regression and runtime tests
benchmarks/   fixed paper benchmark, expected results and reproduction tools

Quick Run

Create a small protocol file:

cat > /tmp/culsma-smoke.culs <<'CULSMA'
protocol CliSmoke {
  let sample = tube(label = "AcquisitionSample", capacity = 2000uL, load = [content(kind = "biosample", code = "S1", type = "cell_sample"):1000uL]);
  return sample;
}
CULSMA

Then run it:

culsma /tmp/culsma-smoke.culs

This prints three compact sections: material use, resources (including container capacities), and the explicit protocol return.

The explicit run form is equivalent:

culsma run /tmp/culsma-smoke.culs

To save those results as JSON:

culsma run /tmp/culsma-smoke.culs --results results.json

The file contains materials, resources, and returns. print(expression); displays the current value immediately on the console during execution. Printed text is separate from saved results. Material rows contain name, amount, and unit; processed samples use their declared input amount, while stock reagents use the amount withdrawn at runtime. Container resource rows contain kind, capacity_uL, and count. Explicit device references use kind, name, and count. returns preserves the complete protocol return objects, including fields omitted from the console preview.

For multiple input files, --results saves an array of these result objects in input order. A failed run writes partial results, reports the failure on stderr, and exits with status 1. --results requires a file path and cannot be combined with --json or --output.

The existing complete run-output format remains available on stdout:

culsma run /tmp/culsma-smoke.culs --json

The run output separates the protocol return from the generated lab report: returns is the program output, while report is the execution/reporting summary.

If you want to save the machine-readable run output explicitly:

culsma run /tmp/culsma-smoke.culs --output tmp/result.json

If you want intermediate and debug artifacts as well:

culsma run \
  /tmp/culsma-smoke.culs \
  --artifacts-dir tmp/run

If you are running from a source checkout without the console entrypoint on PATH, use:

python -m culsma /tmp/culsma-smoke.culs

You can also replay a saved run artifact:

culsma replay --run-json tmp/run/run.json --out tmp/replayed_state.json

Run Tests

python -m pip install -e '.[dev]'
python -m pytest -q

Measure line and branch coverage for the full implementation, including modules that the tests never import:

python -m pytest -q --cov --cov-report=term:skip-covered --cov-report=html --cov-report=xml

Open htmlcov/index.html to inspect missing lines and branches. The Python 3.12 Release Check job runs this command and retains HTML and XML reports for 14 days. Coverage settings and the minimum combined line/branch score live in pyproject.toml.

More

Release Boundary

  • This repository is the public code boundary for Culsma v1.0.x.
  • Public smoke validation uses generated protocol source rather than bundled example files.
  • This repository is licensed under Apache-2.0. See LICENSE.

Support and Maintenance Policy

Culsma is a public open-source reference implementation of the Culsma language and execution stack.

The repository is published as-is. Maintainer review is limited to narrowly scoped, reproducible defects in the current public baseline. General support, custom integration help, roadmap requests, and broad feature requests are out of scope for the public issue tracker.

Brodin Lab affiliation mark

Metadata

Release files for culsma 1.0.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for culsma 1.0.11
File Size Uploaded Provenance Actions
culsma-1.0.11.tar.gz 603.2 kB With provenance Details for culsma-1.0.11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for culsma 1.0.11
File Interpreter ABI Platform Actions
culsma-1.0.11-py3-none-any.whl Python 3 none any Details for culsma-1.0.11-py3-none-any.whl

Total release size: 1.0 MB

Release files / culsma-1.0.11.tar.gz

Download URL culsma-1.0.11.tar.gz
Size 603.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3511af0f2bc294783e6c5d4c24f05b6c26a49f4622880f3461b03108c5a269ee
BLAKE2b-256 checksum
How to use checksums
394e876caec472c7e1722e2694b4ff541426a25356fc428ba35684774e793099
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / culsma-1.0.11-py3-none-any.whl

Download URL culsma-1.0.11-py3-none-any.whl
Size 426.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f022850f97164ad6511eb244edf103d273471c525415779d85ceef3c449817d
BLAKE2b-256 checksum
How to use checksums
212ae2815bc0be91246e5648e95c2042d9590db3393577e4bd45069174a9f193
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Security for culsma 1.0.11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for culsma-1.0.11.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page