Skip to main content

Python client for the GENI Workflows API

Project description

geni-bioinfo

PyPI version License: MIT Python 3.9+

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")

Option 2 — static API token:

from geni import GeniClient

client = GeniClient()
client.auth_token("your-api-token")

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))

API reference

GeniClient

Method Description
auth_login(email, password) Authenticate with email + password (JWT)
auth_token(token) Authenticate with a static API key
user_list() List platform users (admin only)
environment_list(status) List cloud environments (admin only)
engine_list(status) List Nextflow engines (admin only)
queue_list(status) List job queues (admin only)
storage_list(status) List cloud storage resources (admin only)
workflow_create(name, version, file_path, ...) Upload and register a workflow version
workflow_list() List all registered workflow versions
submission_create(workflow_name, engine_id, queue_id, output, params_path, ...) Submit a workflow for execution
submission_list(status) List submissions
submission_get(id) Fetch a single submission by ID
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

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

Tutorial

An interactive Jupyter notebook is available in docs/tutorial.ipynb.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geni_bioinfo-0.1.2.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geni_bioinfo-0.1.2-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file geni_bioinfo-0.1.2.tar.gz.

File metadata

  • Download URL: geni_bioinfo-0.1.2.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for geni_bioinfo-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2f513c6a742d12d58ca81442a239369859759079f8f5503d1895228ee0b91623
MD5 805fb204178f573793a99b2494cbffd5
BLAKE2b-256 80abb86d4b9cfb2126a2bcf03c5e00bebb9a0893d623740f70b8f4d4c65126de

See more details on using hashes here.

File details

Details for the file geni_bioinfo-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: geni_bioinfo-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for geni_bioinfo-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f3a024dd2b3a2da6bbc42e7580a0a1e22218be9df3bec9227889f9f568a40742
MD5 afb4bf842402a8ebd5af3a6591e14aae
BLAKE2b-256 c0801e7663238e9932bb0b0e549b54c258c5e4f3a8b34b3b5e393050a9ac19a8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page