Tools that interact with Agilent's iLab REST architecture.
Project description
UA-Ilab-Tools
A set of tools that interact with Ilab's REST database.
Motivation
Was designed to implement a simple way to interact with Ilab's REST architecture.
Features
- ilab_api.py contains a class to use simple REST functions such as GET, PUT, POST, and DELETE.
- ua_ilab_tools.py contains a class to interact with the REST architecture outside of the simple REST verbs, such as:
- get_service requests which returns the service requests with a given status.
- get_service_cost which returns the cost associated with a given service_id.
- get_request_charges which returns all of the charges of the request id.
- get_milestones which returns all of the milestones associated with a service request.
- get_custom_forms which returns all of the custom forms associated with the request id.
- extract_project_info which gets the relevant project info from a request.
- extract_custom_form_info which gets all of the fields of a form.
Code Example
from ua_ilab_tools import ilab_api, ua_ilab_tools
api = ilab_api.IlabApi(core_id, auth_creds)
# "token" contains the Authorization information for headers.
tools = ua_ilab_tools.IlabTools(core_id, token)
prj_info = ua_ilab_tools.extract_project_info(soup)
form_info = ua_ilab_tools.extract_custom_form_info(
req_id, form_id, form_soup)
Installation
pip install ua-ilab-tools
Tests
You will have to create a file named "ilab_creds.json" in the format of:
{
"token": "Bearer {your token}",
"core_id": "{your core_id}"
}
```bash
pip install --update nose
cd ./ua_ilab_tools
cd ./tests
nosetests test_ilab_tools.py
How to Use
- Get general endpoints
- Get information associated with specific service requests.
- Get data associated with specific projects and custom_forms.
Credits
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
ua_ilab_tools-2.1.0.tar.gz
(10.3 kB
view hashes)
Built Distribution
Close
Hashes for ua_ilab_tools-2.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b67ce5d77783c473e7b08bf3b64d74fd3d8bf0f63b55e946a5eee4a55376c204 |
|
MD5 | 0a47a13971983f87672e467ccf2b70de |
|
BLAKE2b-256 | 14f8e478f36b9f244c398b24f10ed669194c385c8732c22f962453e99fd608fb |