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)
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。
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 synaster_client-0.12.2.tar.gz.
File metadata
- Download URL: synaster_client-0.12.2.tar.gz
- Upload date:
- Size: 24.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 |
ef6c3239112f9010cb31edef45a8d7c72c46fa86a713f2d0dcfe7c7e9bf453ac
|
|
| MD5 |
9f23f8b2326e4af33e4311952f5bb35e
|
|
| BLAKE2b-256 |
e98bd817a609732fe75df7dc46a5114faefd90d2bec0622903a48749429bac7f
|
Provenance
The following attestation bundles were made for synaster_client-0.12.2.tar.gz:
Publisher:
publish-python.yml on macroversus/SynAsterHub
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
synaster_client-0.12.2.tar.gz -
Subject digest:
ef6c3239112f9010cb31edef45a8d7c72c46fa86a713f2d0dcfe7c7e9bf453ac - Sigstore transparency entry: 2383334655
- Sigstore integration time:
-
Permalink:
macroversus/SynAsterHub@1723235eb59d974264e968dc3541f1f68ffc764b -
Branch / Tag:
refs/tags/v0.12.2 - Owner: https://github.com/macroversus
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@1723235eb59d974264e968dc3541f1f68ffc764b -
Trigger Event:
release
-
Statement type:
File details
Details for the file synaster_client-0.12.2-py3-none-any.whl.
File metadata
- Download URL: synaster_client-0.12.2-py3-none-any.whl
- Upload date:
- Size: 25.0 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 |
fb6614f47548b72edee8d692a851ef28f113b2180cc80100de1b5e6f4ada8a5b
|
|
| MD5 |
e2baf403f0b0c0c400bff05100ff3f86
|
|
| BLAKE2b-256 |
30889ff6c027d60e158cebd769a105035a93a10b1d56481b97edb64175c83485
|
Provenance
The following attestation bundles were made for synaster_client-0.12.2-py3-none-any.whl:
Publisher:
publish-python.yml on macroversus/SynAsterHub
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
synaster_client-0.12.2-py3-none-any.whl -
Subject digest:
fb6614f47548b72edee8d692a851ef28f113b2180cc80100de1b5e6f4ada8a5b - Sigstore transparency entry: 2383334784
- Sigstore integration time:
-
Permalink:
macroversus/SynAsterHub@1723235eb59d974264e968dc3541f1f68ffc764b -
Branch / Tag:
refs/tags/v0.12.2 - Owner: https://github.com/macroversus
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@1723235eb59d974264e968dc3541f1f68ffc764b -
Trigger Event:
release
-
Statement type: