Skip to main content

smarts.bio

Official Python SDK for smarts.bio

Run BLAST, GATK, AlphaFold, BWA, DESeq2, and dozens more bioinformatics tools — all through a single API.

PyPI version documentation MIT license


Get started in 2 minutes

  1. Sign up at smarts.bio and create a free account
  2. Generate an API key — Organization Settings → API Keys
  3. Install and run:
pip install smarts-bio
from smartsbio import SmartsBio

client = SmartsBio(api_key="sk_live_...")

response = client.query.run(
    "Run BLAST for ATGCGTAACCGTAA and find homologs in nr database",
    workspace_id="ws_abc",
)
print(response.answer)

Full documentation → smarts.bio/docs


What can you do?

Ask the AI agent anything — it orchestrates the right tools automatically:

Category Tools
Sequence analysis BLAST, HMMER, Clustal Omega, MUSCLE
Variant calling GATK HaplotypeCaller, FreeBayes, DeepVariant
Alignment BWA-MEM, STAR, HISAT2, Bowtie2
Structure prediction AlphaFold, RoseTTAFold, ESMFold
RNA-seq / expression DESeq2, edgeR, Salmon, kallisto
Genome annotation Prokka, Augustus, BRAKER
Literature & databases PubMed, NCBI Gene, UniProt, STRING, ClinVar
Pipelines WES alignment, somatic variant calling, RNA-seq differential expression

These are just some of the tools available. See the full updated list at smarts.bio/docs.


Installation

pip install smarts-bio

Requirements: Python 3.9+. Single dependency: httpx.


Authentication

# Pass directly
client = SmartsBio(api_key="sk_live_...")

# Or set SMARTSBIO_API_KEY environment variable
client = SmartsBio()

Generate your key at chat.smarts.bio → Organization Settings → API Keys.


Examples

Ask a bioinformatics question

response = client.query.run(
    "Find BRCA1 variants associated with breast cancer and summarize the evidence",
    workspace_id="ws_abc",
)
print(response.answer)

Real-time streaming

for chunk in client.query.stream("Align these reads to GRCh38", workspace_id="ws_abc"):
    if chunk.type == "status":
        print(f"[{chunk.status}]")
    elif chunk.type == "content":
        print(chunk.content, end="", flush=True)
    elif chunk.type == "done":
        print("\nDone.")

Run a bioinformatics pipeline

# Upload your FASTQ files
r1 = client.files.upload("sample_R1.fastq.gz", "ws_abc")
r2 = client.files.upload("sample_R2.fastq.gz", "ws_abc")

# Launch a WES alignment pipeline
pipeline = client.pipelines.create(
    "ws_abc",
    input={"fastq_r1": r1.key, "fastq_r2": r2.key, "reference": "GRCh38"},
    pipeline_id="alignment-wes",
)

# Wait for results (polls automatically)
result = client.pipelines.wait(
    pipeline.id,
    "ws_abc",
    on_progress=lambda p: print(f"  {p.progress_pct}% — {p.current_step}"),
)

Async client

import asyncio
from smartsbio import SmartsBioAsync

async def main():
    async with SmartsBioAsync(api_key="sk_live_...") as client:
        response = await client.query.run(
            "Find BRCA1 variants",
            workspace_id="ws_abc",
        )
        print(response.answer)

asyncio.run(main())

Visualize results

result = client.visualizations.viewer_url("orgs/.../variants.vcf", "ws_abc")
print(f"Open in browser: {result.viewer_url}")

SDK Modules

Module Description
client.query Ask the AI agent — sync or streaming SSE
client.workspaces List and manage workspaces
client.conversations Retrieve conversation history
client.tools List available tools and run them directly
client.files Upload, download, and manage files
client.pipelines Launch and monitor long-running bioinformatics pipelines
client.visualizations Generate shareable viewer URLs and render plots

Error Handling

from smartsbio import AuthenticationError, PermissionDeniedError, RateLimitError, APIError

try:
    client.query.run("...")
except AuthenticationError:
    print("Invalid API key")
except PermissionDeniedError as e:
    print(f"Key lacks required scope: {e.required_scope}")
except RateLimitError as e:
    print(f"Rate limited — retry after {e.retry_after}s")
except APIError as e:
    print(f"API error {e.status}: {e.message}")

Configuration

client = SmartsBio(
    api_key="sk_live_...",
    timeout=120,       # seconds (default: 120)
    max_retries=3,     # retries on 429 / 5xx (default: 3)
)

More Examples

See the examples/ directory:


Documentation & Support


Built with ❤️ by the smarts.bio team

Release files for smarts-bio 0.1.2

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

Source distribution (sdist)

Source distribution for smarts-bio 0.1.2
File Size Uploaded
smarts_bio-0.1.2.tar.gz 13.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for smarts-bio 0.1.2
File Interpreter ABI Platform
smarts_bio-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 33.0 kB

Release files / smarts_bio-0.1.2.tar.gz

Download URL smarts_bio-0.1.2.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ea85eafc0aabead5c24c7194318657b7184962bb0eb5093f0c6f84e80a358b71
BLAKE2b-256 checksum
How to use checksums
ec21fc6d127c23003c729cc7b4af4a3a0c54dfb4b6e4e19c419785d5bbf6ef3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release files / smarts_bio-0.1.2-py3-none-any.whl

Download URL smarts_bio-0.1.2-py3-none-any.whl
Size 19.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cbda454370faaaee12e6446200a1175b25bf0a87d4cf0047b049136bd61b2eb0
BLAKE2b-256 checksum
How to use checksums
f7bf649f3bc4c276553922cd3021acb5d043e11fab9a93349e49ed17889f2d13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release history Release notifications | RSS feed

This release

0.1.2 This release

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