Skip to main content

strand-sdk

Python client for Lattice spatial proteomics from H&E. Upload H&E whole-slide images, predict spatially resolved protein-marker maps, and download the virtual mIF channels as AnnData or OME-Zarr/OME-TIFF.

📚 Full documentation: https://docs.strandai.com/sdks/python

Agent-readable API reference: https://app.strandai.com/docs/api.md · LLM index: https://app.strandai.com/llms.txt

Requires Python 3.12+.

Install

pip install strand-sdk
# or with bioinformatics extras (AnnData / zarr):
pip install "strand-sdk[anndata]"

The package also installs the strand command. It supports the same sample and run lifecycle without renaming the SDK-native verbs:

sample_id=$(strand upload biopsy.svs --mpp 0.26 | jq -r .id)
while :; do
  status=$(strand samples get "$sample_id" | jq -r .status)
  case "$status" in ready) break ;; *failed) exit 1 ;; esac
  sleep 2
done
strand predict "$sample_id" -m CD8,PanCK --dry-run
job_id=$(strand predict "$sample_id" -m CD8,PanCK | jq -r .job_id)
strand wait "$job_id" --timeout 1800
strand export "$job_id" --format ome-tiff --out result.ome.tiff --timeout 1800

Use strand cancel "$job_id" for an eligible in-flight run and strand results "$job_id" --out ./results/ for the OME-Zarr tree.

Quickstart

One blocking call runs the full pipeline: upload, submit, wait, and download.

from strand import Client, SampleFieldFilter

client = Client()  # reads STRAND_API_KEY; mint one at https://app.strandai.com/settings/api-keys
result = client.predict(
    "biopsy.ome.tiff",
    markers=["PanCK", "CD8", "CD45"],
    output_dir="./outputs/",
)
print(f"Used {result.credits_used} credits; wrote {len(result.marker_outputs)} markers")

Scoped sample reads and updates use one namespace:

definitions = client.samples.fields()
tags_id = next(field.id for field in definitions if field.key == "tags")
page = client.samples.list(
    scope="mine",
    field=SampleFieldFilter(tags_id, "eq", "trial-042"),
)
sample_id = page.items[0].id
sample = client.samples.get(sample_id)
client.samples.patch(
    sample_id,
    name="Baseline",
    fields={"tags": ["trial-042"]},
    mpp=0.26,
)

estimate = client.predict.submit(sample_id, ["CD8", "PanCK"], dry_run=True)
job = client.predict.submit(sample_id, ["CD8", "PanCK"])

Uploads, model selection, async jobs, public OME-Zarr reads, OME-TIFF export, and error handling are covered in the hosted docs.

Issues & support

File bug reports and feature requests at Strand-AI/strand-sdk-python/issues, or email support@strandai.com. This repository is a generated, read-only mirror of Strand's monorepo. Pull requests opened here are overwritten by the next sync.

License

Apache 2.0

Metadata

Release files for strand-sdk 0.17.0

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

Source distribution (sdist)

Source distribution for strand-sdk 0.17.0
File Size Uploaded
strand_sdk-0.17.0.tar.gz 42.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for strand-sdk 0.17.0
File Interpreter ABI Platform
strand_sdk-0.17.0-py3-none-any.whl Python 3 none any Details

Total release size: 92.7 kB

Release files / strand_sdk-0.17.0.tar.gz

Download URL strand_sdk-0.17.0.tar.gz
Size 42.3 kB
Tags Source
SHA-256 checksum
How to use checksums
66675f7bd70ffdf6fac60cc0ee57c53dc95ca9e5a0e1e5748ff9010a077eda74
BLAKE2b-256 checksum
How to use checksums
1e8d538071cc2e518e37550ba36dba0fce11fd8b9da84d4ffd66598590643627
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 28, 2026.

Transparency log

Release files / strand_sdk-0.17.0-py3-none-any.whl

Download URL strand_sdk-0.17.0-py3-none-any.whl
Size 50.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e1c6fa45690c1302009342271210d4eaaf9f6f306311be25402a6147a17de88b
BLAKE2b-256 checksum
How to use checksums
2126379bf0222926af67bf3fcdc434f3c68a2d024bebd6d6a67018ea8c5d1cf1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.17.0 This release

2 release files

0.16.0

2 release files

0.15.0

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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