Skip to content
ga4ghPublic

About

Generic SDK and CLI for GA4GH API services

Topics

Resources

Stars

15 stars

Watchers

22 watching

Forks

Latest commit

 

History

169 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GA4GH SDK

License Documentation Coverage

Rust clients, Python bindings and a command-line tool for GA4GH API services. Submit and monitor tasks and workflows, resolve access to data objects, retrieve workflow descriptors and discover services.

Use the same SDK in applications, scripts or a downstream SDK with custom endpoints and models. Optional native extensions add workflow contracts and Evidence appraisal.

Documentation · CLI guide · Python guide · Rust API reference

Supported APIs

API What you can do
Task Execution Service (TES) Submit, inspect, list and cancel tasks; follow their state and collect logs.
Workflow Execution Service (WES) Submit workflows with attachments; inspect, list and cancel runs.
Data Repository Service (DRS) Read object metadata, request access URLs and resolve data references.
Tool Registry Service (TRS) Find tools and workflows; retrieve versions, descriptors and files.
Service Info Read metadata from a configured service.
Service Registry Discover services and service types from a registry.

Coverage differs by interface: Service Registry is available in Rust and the CLI, while the other APIs also have Python clients. See the interface matrix for operations and API compatibility for supported contracts and limits.

Installation

Interface Get it Continue with
Python python -m pip install ga4gh-sdk in a virtual environment; CPython 3.11+. Python setup and usage
CLI Download a platform archive from releases. Binary installation and CLI guide
Container docker run --rm ghcr.io/ga4gh/ga4gh-cli:0.1.0 --help Container guide
Rust Add the ga4gh-lib Git dependency; import it as ga4gh_sdk. Rust installation and usage

The installation guide covers platform requirements, checksums, source builds and the distinction between package and import names. The Python distribution contains the bindings; install the CLI separately.

Quick start

The examples below read metadata from a TES service running at http://localhost:8000/ga4gh/tes/v1. Follow the local TES tutorial to start Funnel and submit a first task, or replace this URL with your service's API root.

The API root includes the deployment path, such as /ga4gh/tes/v1; endpoint paths are resolved below it. Configure credentials separately using the authentication guide.

Python

After installing the Python package:

from ga4gh_sdk import Configuration, ServiceInfo

config = Configuration("http://localhost:8000/ga4gh/tes/v1")
print(ServiceInfo(config).get_service_info())

Continue with TES tasks, WES runs, DRS objects or TRS registries.

CLI

Create the configuration directory:

mkdir -p ~/.ga4gh-cli

Then add a TES section to ~/.ga4gh-cli/config.json, keeping any existing sections:

{
  "TES": {
    "base_path": "http://localhost:8000/ga4gh/tes/v1"
  }
}

Read the metadata:

ga4gh-cli service-info --service TES

See the CLI examples for submission and other commands.

Rust

Add the library and an async runtime to your application's Cargo.toml:

[dependencies]
ga4gh-lib = { git = "https://github.com/ga4gh/ga4gh-sdk", tag = "v0.1.0" }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }

Read the metadata:

use ga4gh_sdk::{clients::serviceinfo::ServiceInfo, utils::configuration::Configuration};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = Configuration::new("http://localhost:8000/ga4gh/tes/v1".parse()?);
    let service = ServiceInfo::new(&config)?.get().await?;
    println!("{}", service.name);
    Ok(())
}

Continue with Rust client examples.

Extensions and downstream use

The Extension Manager supports explicitly installed native providers with versioned capabilities. Available providers include:

Extension Purpose
Workflow Pinned I/O validation, invocation plans, result verification and comparison; optional submission through the host WES client.
Confido Standalone Evidence appraisal through a Verifier, with optional collection and appraisal of Service Info Evidence.

Built-in wes commands handle the standard execution API; the workflow extension adds workflow contracts. Confido's appraisal output is for the application's Relying Party policy; it does not establish TLS session binding. See the extensions overview for capabilities and bindings.

To add service-specific endpoints, models or CLI commands in your own crate, follow Build on this SDK. Provider contract RFCs describe proposals separately from implemented features.

Documentation

Task Guide
Configure clients and make API calls Usage
Configure credentials, tokens and OIDC Authentication
Control retries, waiting, paging and workflow preparation Compose service operations
Check API versions and deployment differences API compatibility
Update an existing source integration Source migration notes
Develop and test the SDK Developer guide

The documentation site combines these guides with the Rust and Python API references.

Development

From a clone of this repository, install the pinned Rust toolchain and platform build dependencies as described in the developer setup. With CPython 3.11 or newer, set up the repository tools and run the checks:

python3 -m venv .venv
. .venv/bin/activate
python utils/dependencies/manage.py setup --group dev
make check PYTHON=python

The setup helper installs the repository-pinned uv and Python tools. make check runs dependency checks, formatting, Clippy, the workspace build and default tests. The developer guide covers setup and repository layout; development covers documentation and hooks. Real-service suites are opt-in. Generated models are maintained through the OpenAPI generation workflow.

Versioning

The project follows semantic versioning and is pre-1.0; APIs can change. This README describes main, including features beyond the current release. For a released API, select the matching release tag and its documentation.

Contributing

Report bugs and request features in the issue tracker. To contribute code or documentation, start with the developer guide, contributor guidelines and code of conduct.

License

This project is covered by the Apache License 2.0 also shipped with this repository.

Contact

The project is maintained by ELIXIR Cloud & AAI, a Driver Project of the Global Alliance for Genomics and Health (GA4GH), under the umbrella of the ELIXIR Compute Platform.

To get in touch with us, please use one of the following routes:

  • For filing bug reports, feature requests or other code-related issues, please make use of the project's issue tracker.
  • For private/personal issues, more involved communication, or if you would like to join our team as a regular contributor, you can either join our chat board or email the community leaders.

logo-elixir logo-elixir-cloud-aai

About

Generic SDK and CLI for GA4GH API services

Topics

Resources

Stars

15 stars

Watchers

22 watching

Forks

Releases

Packages

Used by

Contributors

Languages