Python SDK and CLI for Bio-OS.
pybioos now provides a unified root CLI:
bioos --helpThe CLI is organized by resource groups such as workspace, workflow, submission, file, network, ies, dockstore, and docker.
This release expands the unified bioos CLI in three main areas:
- resilient workspace file upload with checkpoint resume and retry support
- workspace member management commands
- account-level usage and resource query commands
- BioOS Network dataset discovery with GA4GH DRS object lookup
It also makes workflow local-file preprocessing more robust and allows downloads from current-workspace s3://... paths.
Install from PyPI:
pip install pybioosInstall from source:
git clone https://github.com/GBA-BI/pybioos.git
cd pybioos
pip install -e .After installation, verify the CLI:
bioos --helppybioos supports three authentication sources, in this order:
- CLI flags:
--ak,--sk,--endpoint - Environment variables:
MIRACLE_ACCESS_KEY,MIRACLE_SECRET_KEY,BIOOS_ENDPOINT - Local config file:
~/.bioos/config.yaml
Recommended approach:
- For local interactive use, prefer
~/.bioos/config.yaml --ak,--sk, and--endpointare currently kept for compatibility and automation scenarios- These explicit authentication flags may be deprecated in a future release, so new integrations should avoid depending on them when possible
Recommended local config file:
client:
MIRACLE_ACCESS_KEY: "your-access-key"
MIRACLE_SECRET_KEY: "your-secret-key"
serveraddr: "https://bio-top.miracle.ac.cn"
region: "cn-north-1"
repository_endpoint: "https://network.miracle.ac.cn"
drs_endpoint: "http://imc-drs.miracle.ac.cn"repository_endpoint and drs_endpoint have these same defaults in the SDK,
so they only need to be written when your deployment uses different Network or
DRS endpoints.
You can inspect the resolved auth status with:
bioos auth statusYou can also print the expected config path and an example payload:
bioos config path
bioos config exampleThe following legacy commands are still available for compatibility:
bwbw_importbw_import_status_checkbw_status_checkget_submission_logs
These commands are legacy compatibility entry points and may be removed in a future release.
New users should use the unified bioos command tree instead:
bw->bioos workflow submitbw_import->bioos workflow importbw_import_status_check->bioos workflow import-statusbw_status_check->bioos workflow run-statusget_submission_logs->bioos submission logs
List workspaces:
bioos workspace listCreate a workspace:
bioos workspace create \
--workspace-name my-workspace \
--workspace-description "My Bio-OS workspace"List workflows in a workspace:
bioos workflow list --workspace-name my-workspaceGenerate an input template:
bioos workflow input-template \
--workspace-name my-workspace \
--workflow-name my-workflowImport a workflow:
bioos workflow import \
--workspace-name my-workspace \
--workflow-name my-workflow \
--workflow-source ./workflow.wdlSubmit a workflow:
bioos workflow submit \
--workspace-name my-workspace \
--workflow-name my-workflow \
--input-json ./input.jsonCheck workflow run status:
bioos workflow run-status \
--workspace-name my-workspace \
--submission-id <submission-id>Download submission logs:
bioos submission logs \
--workspace-name my-workspace \
--submission-id <submission-id>List workspace files:
bioos file list --workspace-name my-workspace --recursiveUpload local files to a workspace:
bioos file upload \
--workspace-name my-workspace \
--source ./inputs/sample1.fastq.gz \
--source ./inputs/sample2.fastq.gz \
--target input_provision/ \
--skip-existingList workspace members:
bioos workspace member list \
--workspace-name my-workspace \
--page-size 100Query account-level usage:
bioos usage resource-total \
--start-time 1776214800 \
--end-time 1776301200List BioOS Network datasets:
bioos network dataset list \
--search-word RNA \
--display-level FullList files under a dataset:
bioos network dataset files \
--data-set-id <data-set-id> \
--data-library-id <data-library-id>Get file IDs under a dataset:
bioos network dataset file-ids \
--data-set-id <data-set-id> \
--data-library-id <data-library-id>Resolve a GA4GH DRS object:
bioos network drs --object-id <object-id>Get a DRS access URL or download a DRS object:
bioos network drs access --object-id <object-id> --access-id https
bioos network drs download --object-id <object-id> --target ./downloads/Top-level command groups:
bioos authbioos configbioos workspacebioos workflowbioos submissionbioos filebioos networkbioos iesbioos dockstorebioos docker
Common examples:
bioos workspace --help
bioos workflow --help
bioos submission --helpCurrent workflow commands:
bioos workflow listbioos workflow input-templatebioos workflow importbioos workflow import-statusbioos workflow run-statusbioos workflow submitbioos workflow validate
Current workspace commands:
bioos workspace listbioos workspace createbioos workspace exportbioos workspace profilebioos workspace dashboard-uploadbioos workspace member listbioos workspace member addbioos workspace member updatebioos workspace member delete
Current file commands:
bioos file uploadbioos file listbioos file downloadbioos file delete
Current Network commands:
bioos network dataset listbioos network dataset getbioos network dataset filesbioos network dataset file-idsbioos network dataset download-filesbioos network dataset drsbioos network drsbioos network drs accessbioos network drs download
Current usage commands:
bioos usage asset-databioos usage asset-listbioos usage asset-totalbioos usage resource-databioos usage resource-workspace-listbioos usage resource-user-listbioos usage resource-total
bioos file upload uploads one or more local files into the current workspace bucket.
Key capabilities:
- multiple
--sourceinputs in one command - multipart upload for large files
- resumable uploads with checkpoint files
- per-file retry controls
--skip-existingsupport- shared upload behavior reused by workflow local-file preprocessing
Example:
bioos file upload \
--workspace-name my-workspace \
--source ./data/sample.bam \
--target input_provision/ \
--checkpoint-dir ~/.bioos/upload-checkpoints \
--max-retries 3 \
--task-num 10Available upload options:
--workspace-name: target workspace name--source: local file path, can be repeated--target: target prefix in the workspace bucket--flatten/--no-flatten: control whether local directory structure is preserved--skip-existing: skip upload when the target key already exists--checkpoint-dir: checkpoint directory for resumable multipart uploads--max-retries: retry count per file after the first attempt--task-num: multipart parallel task count
bioos file download supports:
- internal workspace object keys such as
input_provision/a.txt - current-workspace
s3://bucket/keypaths
If an s3://... path points to a different bucket than the current workspace bucket, the CLI raises a clear bucket mismatch error instead of attempting a cross-workspace download.
bioos workflow submit automatically scans input.json for local file paths before submission.
Compared with the earlier implementation, the current behavior is more robust:
- recursively traverses real JSON structures instead of regex-scanning the serialized JSON string
- supports singleton
{...}and batch[{...}, {...}]inputs - correctly recognizes Chinese paths and paths containing spaces
- preserves non-local values such as
drs://...and existings3://... - replaces only exact matched local-path values with uploaded
s3://...locations
This preprocessing path reuses the same resilient upload helper as bioos file upload.
Workspace member operations are available under bioos workspace member.
Examples:
bioos workspace member list \
--workspace-name my-workspace \
--page-size 100
bioos workspace member add \
--workspace-name my-workspace \
--name alice \
--name bob \
--role User
bioos workspace member update \
--workspace-name my-workspace \
--name alice \
--role Admin
bioos workspace member delete \
--workspace-name my-workspace \
--name aliceNotes:
member listdefaults toInWorkspace=true, so it lists users already in the workspacemember listalso supports--page-number,--page-size,--keyword,--role, and--no-in-workspace- supported member roles are
Visitor,User, andAdmin
Account-level usage commands are available under bioos usage.
Examples:
bioos usage asset-total \
--start-time 1776214800 \
--end-time 1776301200 \
--type WorkspaceVisit
bioos usage resource-user-list \
--start-time 1776214800 \
--end-time 1776301200
bioos usage resource-data \
--start-time 1776214800 \
--end-time 1776301200 \
--type cpuNotes:
- usage APIs are account-level, not workspace-scoped
- some usage APIs are only available to the account owner
- when a sub-account calls owner-only usage APIs, pybioos returns a clearer permission error instead of exposing the raw backend error payload
tosis still pinned to2.5.6in this releasepandas>=1.3.0is still supported in this release- workflow batch preprocessing currently uses a temporary
DataFrame.map/applymapcompatibility shim so the same code can run on both older pandas releases and newer environments such as pandas 3.x - this pandas compatibility shim is transitional and is expected to be removed in the next release after the minimum supported pandas version is raised to
2.1+ - legacy commands such as
bwandbw_importare still available for compatibility, but new integrations should use the unifiedbiooscommand tree
- directory upload is not supported yet;
bioos file uploadcurrently accepts files, not whole directories bioos file downloaddoes not yet support direct signedhttps://...download URLs- usage commands depend on backend permissions; owner-only APIs require the main account AK/SK
from bioos import bioos
bioos.login(
endpoint="https://bio-top.miracle.ac.cn",
access_key="your-access-key",
secret_key="your-secret-key",
)
workspaces = bioos.list_workspaces()
print(workspaces)Use a workspace object:
from bioos import bioos
bioos.login(
endpoint="https://bio-top.miracle.ac.cn",
access_key="your-access-key",
secret_key="your-secret-key",
)
workspace_id = "your-workspace-id"
ws = bioos.Workspace(workspace_id)
print(ws)Full documentation is available at https://pybioos.readthedocs.io/.
For notebook-style examples, see Example_usage.ipynb.