Skip to main content

Python SDK/Library for IAP

Project description

libiap

Python SDK/Library for IAP -- https://umccr-illumina.github.io/libiap/

TL;DR

  • Install through pip like so:
pip install libiap
  • Export IAP base URL and auth token:
export IAP_BASE_URL=<baseUrl>
export IAP_AUTH_TOKEN=<tok>
  • Somewhere in your Python code:
from libiap import libgds

for file in libgds.list_files(volume_name='my-gds-volume-name'):
    print(file)
  • Using OpenAPI:
import os
from libiap.openapi import libwes
from libiap.openapi.libwes import WorkflowList, WorkflowCompact

iap_auth_token = os.getenv("IAP_AUTH_TOKEN")
iap_base_url = os.getenv("IAP_BASE_URL")

configuration = libwes.Configuration(
    host=iap_base_url,
    api_key={
        'Authorization': iap_auth_token
    },
    api_key_prefix={
        'Authorization': "Bearer"
    },
)

with libwes.ApiClient(configuration) as api_client:

    wfl_api: libwes.WorkflowsApi = libwes.WorkflowsApi(api_client)
    try:
        page_token = None
        while True:
            wfl_list: WorkflowList = wfl_api.list_workflows(page_size=100, page_token=page_token)
            # print(wfl_list)
            for item in wfl_list.items:
                wfl: WorkflowCompact = item
                print(wfl.id)
                print(wfl.name)
            page_token = wfl_list.next_page_token
            if not wfl_list.next_page_token:
                break
    except libwes.ApiException as e:
        print(e)

Development

  • Pilot run or Integration Test:
export IAP_BASE_URL=<baseUrl>
export IAP_AUTH_TOKEN=<tok>
python pilot.py

License

MIT License and DISCLAIMER

License: MIT

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

libiap-0.2.0.tar.gz (186.9 kB view hashes)

Uploaded Source

Built Distribution

libiap-0.2.0-py3-none-any.whl (477.3 kB view hashes)

Uploaded Python 3

Supported by

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