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 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

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.16.0.tar.gz (39.1 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.16.0-py3-none-any.whl (47.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: strand_sdk-0.16.0.tar.gz
  • Upload date:
  • Size: 39.1 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.16.0.tar.gz
Algorithm Hash digest
SHA256 d73eb1085238db3b5d288b6283d395b8f0b3fb2fc46d990b0e90ca375477e5b1
MD5 3f635269d71a7c058752cf4d9a91aa0d
BLAKE2b-256 ab9ba53046abf1320e3b1b5a49970190c5c8d53788670ce58c84e5cf3e32ca65

See more details on using hashes here.

Provenance

The following attestation bundles were made for strand_sdk-0.16.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.16.0-py3-none-any.whl.

File metadata

  • Download URL: strand_sdk-0.16.0-py3-none-any.whl
  • Upload date:
  • Size: 47.2 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.16.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2bd6bc919446a6c7eb4f57fa1ef58c3f677d7907cea6fcbd4b681164e758d693
MD5 ace66e1cb2d61a21a9410ec94a559d2c
BLAKE2b-256 b233441b17c05b45576649c9688d9acd2d926e336953f172fd7222b7b0ca80ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for strand_sdk-0.16.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.

Release history Release notifications | RSS feed

This release

0.16.0 This release

2 files

0.15.0

2 files

0.14.0

2 files

0.13.0

2 files

0.12.0

2 files

0.11.0

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page