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.1.tar.gz (36.9 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.1-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for geni_bioinfo-0.1.1.tar.gz
Algorithm Hash digest
SHA256 db8fa9b74b876c6b5561b8545ea1adb88d738a7d8e5ebfb064a57ba744d5e0a9
MD5 04fb2136aef5e57f9f54339b656f0add
BLAKE2b-256 c2b4cdc3e193aaf0c0fd51cce621f85328accb586a0f229c9646d612298ac85d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for geni_bioinfo-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 161e3456ad62a140a4b26e2668beda2e77d4a8a0000d87c74b422e2aa0b07965
MD5 724871af8047a91efa44327c662dde13
BLAKE2b-256 db921a28f04bced2dd13bb10ec8890207f484b9c8546485fccead44d2e598351

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