Skip to main content

synaster-client 中文使用说明

这是 SynAster 官方轻量 Python SDK 与 synaster 命令行客户端,面向终端用户、 Python 程序和 AI Agent。客户端复用现有 Bohrium OpenAPI,不会安装或运行 FastAPI、Celery、Redis、Nextflow 或科学计算工具容器。

要求 Python 3.10 或更高版本。

安装

pipx install synaster-client
synaster --version

# 临时执行,不写入当前 Python 环境
uvx --from synaster-client synaster --version

命令行入口与模块入口完全等价:

synaster skills --json
python -m synaster_client skills --json

安全认证与运行

AccessKey 只能通过 SYNASTER_ACCESS_KEY 环境变量,或配合 --access-key-stdin 从标准输入读取一行。客户端故意不提供 --access-key VALUE,并拒绝配置文件中的密钥字段。

export SYNASTER_ACCESS_KEY="<你的 Bohrium AccessKey>"

synaster doctor
synaster describe adabmdca
synaster run adabmdca \
  --input family_msa.fasta \
  --file query=query.fasta

使用 submit 只发送一次提交请求,随后可用返回的任务 ID 恢复:

synaster submit tmpred --input proteins.fasta
synaster wait <task-id>
synaster download <task-id>

使用 --mode bohr 时,CLI 会刷新实时机型价格,并要求对本次命令明确确认费用。 所有任务提交请求都不会自动重试。

完整的命令、JSON、退出码、恢复、下载和 Python SDK 说明见仓库内 docs/synaster-cli-sop.md。

Python SDK

Python 类名、方法名和结构化字段保持英文,以保证程序兼容;公开说明、异常消息和 CLI 人类可读输出使用简体中文。

提交 hosted 任务并等待结果

import os

from synaster_client import SynAsterClient


with SynAsterClient(access_key=os.environ["SYNASTER_ACCESS_KEY"]) as client:
    request = client.build_request(
        "tmpred",
        input_path="proteins.fasta",
        execution_mode="hosted",
    )
    result = client.run(request, output_dir="synaster-results/tmpred")

print(result.status.status)
print(result.result_files)
print(result.status.warnings)  # 非空时先检查下载目录中的完整性报告

run() 严格执行“提交一次 → 等待 → 下载”。如果进程中断,请保留任务 ID,使用 get_status() 或 wait() 恢复;不要重新提交可能已经创建的任务。

捕获类型化异常

from synaster_client import (
    SynAsterError,
    SynAsterRemoteTaskError,
    SynAsterWaitError,
)

try:
    result = client.run(request)
except SynAsterWaitError as exc:
    print(f"本地等待未完成,可继续查询任务:{exc.task_id}")
except SynAsterRemoteTaskError as exc:
    print(f"远端任务失败:{exc.message}")
except SynAsterError as exc:
    print(f"SynAster 调用失败:{exc.message}")

Bohrium 费用安全

bohr 高层 run() 必须传入与实时 bohr-options 一致的 BohrChargeConfirmation。SDK 不会替调用方取得费用授权;提交响应超时或断连时, 异常可能带有 submission_uncertain=True,此时先到 Bohrium 控制台排查,禁止自动重提。

稳定接口说明

  • 命令名、Python 类名/方法名、JSON 字段和 error.kind 保持英文,便于脚本稳定解析。
  • CLI 默认人类输出、帮助、交互提示和 SDK 本地异常消息使用简体中文。
  • --json 的 stdout 始终只输出一个 JSON 对象,进度与费用提示写入 stderr。
  • 默认生产地址为 https://open.bohrium.com/openapi/v1/syn-aster。

Metadata

Release files for synaster-client 0.17.0

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

Source distribution (sdist)

Source distribution for synaster-client 0.17.0
File Size Uploaded Provenance Actions
synaster_client-0.17.0.tar.gz 26.8 kB With provenance Details for synaster_client-0.17.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for synaster-client 0.17.0
File Interpreter ABI Platform Actions
synaster_client-0.17.0-py3-none-any.whl Python 3 none any Details for synaster_client-0.17.0-py3-none-any.whl

Total release size: 54.1 kB

Release files / synaster_client-0.17.0.tar.gz

Download URL synaster_client-0.17.0.tar.gz
Size 26.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9bb577112e80b25254f554ca63bcc71f0796cedf6adbe9c6eb6afd8586570336
BLAKE2b-256 checksum
How to use checksums
7e3240a6b691e0fd2b81918acc5bda5701ffd32676cf18b41128bc4fa560ec7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / synaster_client-0.17.0-py3-none-any.whl

Download URL synaster_client-0.17.0-py3-none-any.whl
Size 27.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
17bceed7d601961de7c3715e8913e230150d7ce487ae06edce4d5b0ea8c18733
BLAKE2b-256 checksum
How to use checksums
ba9f0b7344418e9b4a11cd0aa4cd8256d33ad55270694e7f5f4abf263cabbc1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Security for synaster-client 0.17.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for synaster_client-0.17.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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