Skip to main content

strand-sdk

Python client for the Strand Platform: upload H&E whole-slide images, run virtual multiplex-immunofluorescence inference (H&E → spatial proteomics), and download per-marker predictions 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 ome-tiff "$job_id" --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

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

Scoped sample reads and updates use one namespace:

page = client.samples.list(scope="mine", tag="trial-042")
sample_id = page.items[0].id
sample = client.samples.get(sample_id)
client.samples.patch(sample_id, name="Baseline", 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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

strand_sdk-0.15.0.tar.gz (38.4 kB view details)

Uploaded Source

Built Distribution

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

strand_sdk-0.15.0-py3-none-any.whl (46.4 kB view details)

Uploaded Python 3

File details

Details for the file strand_sdk-0.15.0.tar.gz.

File metadata

  • Download URL: strand_sdk-0.15.0.tar.gz
  • Upload date:
  • Size: 38.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for strand_sdk-0.15.0.tar.gz
Algorithm Hash digest
SHA256 e2b6b935accb479637430db447550fed93b93b4dbd506681a2fc1adea69d7527
MD5 0f884e3df7add93e6f9987390dcf6a5b
BLAKE2b-256 eb015fab902c7e880310bae2db0eca8a4d431b9665e75778abdcaa2692a9f113

See more details on using hashes here.

Provenance

The following attestation bundles were made for strand_sdk-0.15.0.tar.gz:

Publisher: sdks-publish.yml on Strand-AI/strand-official

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

File details

Details for the file strand_sdk-0.15.0-py3-none-any.whl.

File metadata

  • Download URL: strand_sdk-0.15.0-py3-none-any.whl
  • Upload date:
  • Size: 46.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for strand_sdk-0.15.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb953e28f39701050718420c9eda6cfa739b2f7f313f620b2748867bfca680f7
MD5 aacef8d8ea207fddef2c629d1269c726
BLAKE2b-256 de198db3ed0c1779fb8b0ea0f5c72ac782f548a532b94caffdca2c3dad02ce59

See more details on using hashes here.

Provenance

The following attestation bundles were made for strand_sdk-0.15.0-py3-none-any.whl:

Publisher: sdks-publish.yml on Strand-AI/strand-official

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 Sentry Error logging StatusPage Status page