Skip to main content

Official Python SDK and CLI for the FastFold API

Project description

FastFold Python SDK and CLI

Python client and CLI for the FastFold Jobs API.

Installation

From the project root:

pip install .

Or for development:

pip install -e .

Requires Python 3.8+.

Authentication

Set your API key in the environment:

export FASTFOLD_API_KEY="sk-...your-api-key"

You can also pass an API key when creating the client or via the CLI flag --api-key.

SDK Usage

from fastfold import Client

client = Client()  # Reads FASTFOLD_API_KEY from env by default

response = client.fold.create(
    sequence="LLGDFFRKSKEKIGKEFKRIVQRIKDFLRNLVPRTES",
    model="boltz-2",
)

print(response.id)  # jobId

Advanced options:

job = client.fold.create(
    sequence="...",
    model="boltz-2",
    name="My Job",
    from_id=None,  # maps to ?from=<uuid>
    params={"recyclingSteps": 3},  # merged into params
    constraints={
        "pocket": [
            {
                "binder": {"chain_id": "A"},
                "contacts": [{"chain_id": "B", "res_idx": 10}],
            }
        ]
    },
)

CLI Usage

Submit a folding job:

fastfold fold --sequence "LLGDFFRKSKEKIGKEFKRIVQRIKDFLRNLVPRTES" --model boltz-2

Optional flags:

fastfold fold \
  --sequence "..." \
  --model boltz-2 \
  --name "My Job" \
  --api-key "sk-..." \
  --base-url "https://api.fastfold.ai"

On success the CLI prints the created job ID to stdout.

Python API Reference (minimal)

  • Client(api_key: Optional[str] = None, base_url: Optional[str] = None, timeout: float = 30.0)
    • Reads FASTFOLD_API_KEY if api_key is not provided.
  • Client.fold.create(sequence: str, model: str, name: Optional[str] = None, from_id: Optional[str] = None, params: Optional[dict] = None, constraints: Optional[dict] = None) -> Job
    • Returns a Job object with id, run_id, name, status, sequence_ids, and raw.

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

fastfold_ai-0.1.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

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

fastfold_ai-0.1.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fastfold_ai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 21e1a4db1978feb853d32d0d6cbdc334bc05463c6307fb2e88d69110246788fe
MD5 b16a2c7c21e8a41030f8143dc77720d2
BLAKE2b-256 ac9c3cb20200b201644c84051ccb5c7351887c8cb469df09100e3d4e92d4d450

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for fastfold_ai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 01c25246d262f0c92b881339a2e970dc2ad9560fa34312c244d05fa9dfac003f
MD5 f7af8819db4f33c1e318a18885acd6a8
BLAKE2b-256 036f6244424793520e8358d4a4f508b95c5c9fe2c0d9245a0f28bb892e0d91fe

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