Skip to main content

Python SDK for Proto Bio APIs

Project description

Proto Client

Proto Client

Checks Unit Tests proto-client is the official Python SDK for the Proto project. Run any of 80+ bioinformatics tools from proto-tools, submit optimization runs built with proto-language, stream logs, and download results, all from a few lines of typed Python.

The SDK provides a synchronous ProtoClient and an asynchronous AsyncProtoClient with the same surface, fully type-checked responses, and transport-level retries. It also includes an MCP server, so Claude, Cursor, VS Code Copilot, and any other MCP-compatible agent can call the same APIs through natural language.

Installation

All you need is Python 3.10+ and pip:

pip install proto-client

The MCP server is an optional extra:

pip install proto-client[mcp]

Quickstart

Set PROTO_API_KEY in your environment (or pass api_key= explicitly), then:

from proto_client import ProtoClient

client = ProtoClient()

# Run a bioinformatics tool and poll to completion (tools API)
job = client.tools.run("esmfold-prediction", {"sequences": ["MKTL"]})

# Submit an optimization run and poll to completion (runs API)
run = client.runs.run(program_data={...})

Async

Every namespace has an identical async surface. await the calls and use the client as an async context manager:

from proto_client import AsyncProtoClient

async with AsyncProtoClient() as client:
    run = await client.runs.create(program_data={...})
    status = await client.runs.get(run.run_id)

Working with output assets

Large cloud outputs (structures, logits, PAE matrices, embeddings) come back as AssetRef objects rather than inline JSON; the client.assets namespace downloads, decodes, or streams them to disk on demand. See Working with output assets for the methods, MIME decoding, and examples.

Exporting a run's results

There are two export routes, depending on where the program ran:

Where the program ran Use What you get
Locally in Python (program.run()) client.export_program(program, "out/") Folder with 4 CSV tables + sequences.fasta + assets/; writes local seq.structure / seq.logits and downloads any AssetRefs found in metadata
On the server (client.runs.create(...)) client.runs.export(run_id, "out.zip") Server-built zip with 4 CSV tables + FASTA + program.json + manifest.json + assets/

The two cover non-overlapping data: the local route needs the live Program object (because seq.structure / seq.logits only exist client-side), the server route needs a run_id (because the results live in the API database). Pick by which one you have.

# Local Program (proto-language installed alongside proto-client)
program = Program(...)
program.run()
client.export_program(program, "out/")

# Server-side Run
run = client.runs.run(program_data=...)  # creates and polls to terminal status
client.runs.export(run.id, "out.zip")

For a single asset rather than the whole bundle, use client.assets.download(ref, path). Both export routes have async equivalents: await client.export_program(...) and await client.runs.export(...).

Command line

A minimal proto-client CLI submits tools and optimization runs from a shell or CI, then writes the result JSON and downloads any output assets:

proto-client me                                                    # workspace and credits
proto-client tools run esmfold-prediction --inputs in.json --assets ./out
proto-client runs submit program.json --wait --export out.zip

See the CLI guide for the full command reference.

Using with AI agents (MCP)

proto-client includes an MCP server so Claude, Claude Desktop, Cursor, VS Code Copilot, Codex, Gemini, and any other MCP-compatible agent can call the Proto Bio APIs through natural language. Connect to the hosted endpoint (nothing to install).

See the MCP user guide for per-agent connection snippets, the tool/prompt/resource surface, and a guided walkthrough.

Project details


Download files

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

Source Distribution

proto_client-0.1.0.tar.gz (89.7 kB view details)

Uploaded Source

Built Distribution

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

proto_client-0.1.0-py3-none-any.whl (64.6 kB view details)

Uploaded Python 3

File details

Details for the file proto_client-0.1.0.tar.gz.

File metadata

  • Download URL: proto_client-0.1.0.tar.gz
  • Upload date:
  • Size: 89.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for proto_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1a022b5b8b52eb15ea776d6fa07bfe9e78e218c09fa5c906926383341caeae8f
MD5 99568dd261f0c393b918bd4be3b3250b
BLAKE2b-256 f87e210ab975c22e0789f7be2491c5d812f4bbc6a165e65684a2d612106350f5

See more details on using hashes here.

File details

Details for the file proto_client-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: proto_client-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 64.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for proto_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8090f90d5deaf3a5ba36ea5a97801e15cbe7582e6cd06ba1527e2f72e30f690c
MD5 9f60185bafb28dcbb28218bda2197fc5
BLAKE2b-256 d2c4f3e3be2db2e592a99ad07a6ab38576182bf2203a35780e33247a540483a1

See more details on using hashes here.

Supported by

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