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

Security

  • Never hardcode credentials. Use the GENI_API_URL environment variable for the API URL and load tokens from a secrets manager or .env file.
  • All API calls use HTTPS.
  • See SECURITY.md for the vulnerability reporting policy.

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.0.tar.gz (12.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.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: geni_bioinfo-0.1.0.tar.gz
  • Upload date:
  • Size: 12.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.0.tar.gz
Algorithm Hash digest
SHA256 7e31b3c5c0ba441a2f60d569043a09bffc2e1e8179fb7336280ba4bb00b730df
MD5 b2b00949c7a5178bd9e4841a2a05ee00
BLAKE2b-256 23c4b6def9d93c9e6e1b14843fcec18bc56bd2fac1251a7ab7548a04270d41bc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: geni_bioinfo-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f29b26b7bc32c1886c9815e760843db6a02309d62cbae0c54af89ef4216b96f8
MD5 c9c7dc47fcc82397c4ff482847b8aa88
BLAKE2b-256 584f68dfe4b275a204d7e2dacbca7c17fce974883a599c83eeeb2d7a4796f9af

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