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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d73eb1085238db3b5d288b6283d395b8f0b3fb2fc46d990b0e90ca375477e5b1
|
|
| MD5 |
3f635269d71a7c058752cf4d9a91aa0d
|
|
| BLAKE2b-256 |
ab9ba53046abf1320e3b1b5a49970190c5c8d53788670ce58c84e5cf3e32ca65
|
Provenance
The following attestation bundles were made for strand_sdk-0.16.0.tar.gz:
Publisher:
sdks-publish.yml on Strand-AI/strand-official
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
strand_sdk-0.16.0.tar.gz -
Subject digest:
d73eb1085238db3b5d288b6283d395b8f0b3fb2fc46d990b0e90ca375477e5b1 - Sigstore transparency entry: 2541454892
- Sigstore integration time:
-
Permalink:
Strand-AI/strand-official@5a9a5fde9979b502756a3a5cb0dc6098d8475e45 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Strand-AI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
sdks-publish.yml@5a9a5fde9979b502756a3a5cb0dc6098d8475e45 -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bd6bc919446a6c7eb4f57fa1ef58c3f677d7907cea6fcbd4b681164e758d693
|
|
| MD5 |
ace66e1cb2d61a21a9410ec94a559d2c
|
|
| BLAKE2b-256 |
b233441b17c05b45576649c9688d9acd2d926e336953f172fd7222b7b0ca80ef
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
strand_sdk-0.16.0-py3-none-any.whl -
Subject digest:
2bd6bc919446a6c7eb4f57fa1ef58c3f677d7907cea6fcbd4b681164e758d693 - Sigstore transparency entry: 2541456690
- Sigstore integration time:
-
Permalink:
Strand-AI/strand-official@5a9a5fde9979b502756a3a5cb0dc6098d8475e45 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Strand-AI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
sdks-publish.yml@5a9a5fde9979b502756a3a5cb0dc6098d8475e45 -
Trigger Event:
workflow_dispatch
-
Statement type: