Python SDK/Library for IAP
Project description
libiap
Python SDK/Library for IAP -- https://umccr-illumina.github.io/libiap/
- Tested for Python 3.6, 3.7, 3.8
- Test Coverage
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:
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)
More examples available at:
Development
-
Setup virtual environment and activate it
-
Install dependencies
make install
- To run unit tests suite
make unit
- To bring up mock API μ-services
make up
- To run integration tests suite (required services fully up)
make it
- To run full test suite (required services fully up)
make test
- Most of the dev pipelines are in
Makefile
workflow
License
MIT License and DISCLAIMER
Project details
Release history Release notifications | RSS feed
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.4.0rc1.tar.gz
(200.9 kB
view hashes)
Built Distribution
libiap-0.4.0rc1-py3-none-any.whl
(520.1 kB
view hashes)
Close
Hashes for libiap-0.4.0rc1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64d22b1a3cef28c917dec3556b1bc1a1ce48099b293ff014e62a83dc538179eb |
|
MD5 | 2f174679191e4b17db22a03e96ea3a84 |
|
BLAKE2b-256 | 1673be132df69c99720c349651c5abb9e736680dbb6ba81a5b290d31f4af4249 |