geni-bioinfo
Python client library for the GENI Workflows API — a bioinformatics platform for submitting and managing Nextflow workflow executions on cloud infrastructure.
Installation
pip install geni-bioinfo
Quick start
Authentication
Option 1 — email and password (JWT):
from geni import GeniClient
client = GeniClient()
client.auth_login("you@example.com", "your-password")
The client keeps the session's refresh token: when the access token expires, the next
request refreshes it once and retries, so long-running scripts stay logged in.
client.auth_refresh() renews it ahead of time, and client.auth_logout() revokes it.
Option 2 — static API token:
from geni import GeniClient
client = GeniClient()
client.auth_token("your-api-token")
Listing everything
List methods return one page (limit, default 50; offset). Each has an iter_* twin
that pages to the end:
from datetime import date
for sub in client.iter_submissions(status="failed", start_date=date(2026, 10, 1)):
print(sub.id, sub.workflow_name)
Errors
from geni.exceptions import GeniAPIError
try:
client.queue_create("spot", environment_id, max_vcpus=0)
except GeniAPIError as e:
print(e.status_code, e.problem_type) # e.g. 400 and None, or 409 and "resource-disabled"
for err in e.field_errors: # [{"field": ..., "message": ...}]
print(err["field"], err["message"])
The API URL defaults to https://workflows-api.geni-bioinfo.com.br. Override it with the GENI_API_URL environment variable or the api_url constructor argument.
Core workflow
from geni import GeniClient
client = GeniClient()
client.auth_token("your-api-token")
# 1. Upload a workflow
wf = client.workflow_create(
name="hello-world",
version="1.0.0",
file_path="hello.nf",
)
print(wf.name, wf.version)
# 2. Discover available engines and queues
engines = client.engine_list(status="active")
queues = client.queue_list(status="active")
# 3. Submit the workflow
submission = client.submission_create(
workflow_name="hello-world",
engine_id=engines[0].id,
queue_id=queues[0].id,
output="s3://my-bucket/runs/hello-001",
params_path="params.yml",
)
print(submission.submission_id, submission.status)
# 4. Poll status
sub = client.submission_get(submission.submission_id)
print(sub.status)
# 5. Stream logs
print(client.submission_logs(submission.submission_id, text=True))
Tagging
Tag keys live in one registry shared by workflows and submissions, and must be created first:
client.tag_create("client")
client.tag_create("project")
# Workflow tags apply to every version and are inherited by its submissions.
client.workflow_create(
name="hello-world", version="1.0.0", file_path="hello.nf",
tags={"client": "lab", "project": "x"},
)
client.workflow_update_tags(
"hello-world",
edit=[{"key": "client", "value": "acme"}],
remove=["project"],
)
client.workflow_list(tags={"client": "acme"})
# A submission tag overrides the workflow's value for the same key.
client.submission_create(..., tags={"client": "other"})
Tags are copied onto the submission when it is created, so editing a workflow's tags later does not change submissions that already exist.
Restore and immutability (admin only)
# Bring back a soft-deleted version (raises GeniAPIError with status_code 409 if it isn't deleted),
# or a whole workflow with all its versions.
client.workflow_version_restore("hello-world", "1.0.0")
client.workflow_restore("hello-world")
# Immutability only blocks overwriting a version by re-uploading the same name and version.
v = client.workflow_version_set_immutable("hello-world", "1.0.0", True)
print(v.immutable) # True
Enable and disable resources
Disable an engine or queue to retire it without deleting its cloud resources. New submissions and
retries that target it are rejected with GeniAPIError (status_code == 409); running
submissions continue. Engines and queues need an admin (or GENI support); environments can only
be toggled by GENI support, who must pass tenant_id.
client.queue_disable(queue_id)
client.queue_list(enabled=False) # what is currently disabled
client.queue_enable(queue_id)
API reference
GeniClient
| Method | Description |
|---|---|
auth_login(email, password) |
Authenticate with email + password (JWT) |
auth_token(token) |
Authenticate with a static API key |
auth_refresh() / auth_logout() |
Renew or revoke the login session |
user_list() |
List platform users (admin only) |
environment_list(status, enabled) |
List cloud environments (admin only) |
engine_list(status, environment_id, engine, enabled) |
List engines, optionally filtered by environment, engine type (nextflow/cromwell) or enabled flag (admin only) |
queue_list(status, environment_id, execution_mode, enabled) |
List job queues, optionally filtered by environment, execution mode (spot/on-demand) or enabled flag (admin only) |
engine_enable(id) / engine_disable(id) |
Allow or reject new submissions to an engine (admin or support) |
queue_enable(id) / queue_disable(id) |
Allow or reject new submissions to a queue (admin or support) |
environment_enable(id, tenant_id) / environment_disable(id, tenant_id) |
Allow or reject new submissions to everything in an environment (GENI support only) |
storage_list(status) |
List cloud storage resources (admin only) |
environment_create/update/delete, engine_create/update/delete, queue_create/update_ami/delete, storage_create/delete, plugin_create/delete, registry_create/delete |
Manage infrastructure; asynchronous, poll the matching *_get (admin; environments support only) |
registry_auth(id) |
Short-lived ECR push credentials (admin only) |
iter_* (iter_submissions, iter_tasks, iter_queues, …) |
Every item of the matching *_list, paging through limit/offset |
workflow_create(name, version, file_path, tags=..., ...) |
Upload and register a workflow version |
workflow_list(tags=...) |
List all registered workflow versions, optionally filtered by tag |
workflow_update_tags(name, add, edit, remove) |
Add, change, or remove tags on a workflow |
workflow_versions(name, deleted=False) |
List a workflow's active (or soft-deleted) versions |
workflow_delete(name) / workflow_version_delete(name, version) |
Soft-delete a workflow (all versions) or one version |
workflow_restore(name) / workflow_version_restore(name, version) |
Restore a soft-deleted workflow or version (admin only) |
workflow_version_set_immutable(name, version, immutable) |
Change a version's overwrite guard (admin only) |
submission_create(workflow_name, engine_id, queue_id, output, params_path, ...) |
Submit a workflow for execution; nextflow_profile="test,docker" selects Nextflow profiles |
submission_list(status, from_, to, start_date, end_date, limit, offset, ...) |
List submissions (iter_submissions for all) |
submission_get(id) |
Fetch a single submission by ID |
submission_inputs(id, output_file=None) |
Download the original JSON/YAML inputs as bytes, optionally writing a file |
submission_cancel(id) |
Cancel a running submission |
task_list(submission_id) |
List tasks for a submission |
task_logs(submission_id, task_id, text) |
Fetch task log entries |
submission_logs(submission_id, text) |
Fetch submission-level Nextflow logs |
cost_summary(start_date, end_date, daily=False) |
Total cost, or per day (analytics:read) |
Exceptions
| Exception | Raised when |
|---|---|
GeniConfigError |
auth_login() or auth_token() was not called before a request |
GeniAuthError |
Invalid credentials or insufficient permissions (HTTP 401/403) |
GeniNotFoundError |
A resource ID does not exist (HTTP 404) |
GeniAPIError |
Any other unexpected HTTP error; exposes .status_code, .method, .url, .response_body |
Every exception also has .problem_type (the API's error token, or None) and .field_errors.
Tutorial
An interactive Jupyter notebook is available in docs/tutorial.ipynb.
License
MIT — see LICENSE.
Metadata
Release files for geni-bioinfo 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| geni_bioinfo-0.2.0.tar.gz | 119.8 kB | Without provenance | Details for geni_bioinfo-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| geni_bioinfo-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for geni_bioinfo-0.2.0-py3-none-any.whl |
Total release size: 150.1 kB
Release files / geni_bioinfo-0.2.0.tar.gz
| Download URL | geni_bioinfo-0.2.0.tar.gz |
|---|---|
| Size | 119.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0524d0ad056d3f5df01ff01580bce4df9673ecd54c168b2ef262fad8097f2681
|
|
BLAKE2b-256 checksum How to use checksums |
8e1d219c32ca1ca76472dca7531552a3813b502c3d839cff5990ff16d08cfa4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Release files / geni_bioinfo-0.2.0-py3-none-any.whl
| Download URL | geni_bioinfo-0.2.0-py3-none-any.whl |
|---|---|
| Size | 30.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
accec0e32a5d47d38b37ec097e7fc5fda362ab32c01a319cf5d116a12f143dc9
|
|
BLAKE2b-256 checksum How to use checksums |
8f424d55d93466c68a676bca36a812bd7626648fb2429cd5fec29123b452c46c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Security for geni-bioinfo 0.2.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.