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.1.tar.gz
(10.8 kB
view hashes)
Built Distribution
Close
Hashes for ua_ilab_tools-2.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1dc258c9493e7dfd50440a71e7f2dd1289c26f9e33e1789fc9275bb059c037f9 |
|
MD5 | 4b6c9db71f54c13576bd2afabcbf7d15 |
|
BLAKE2b-256 | 434cf64927dcc8545f592d99d2f7d803eb090c767be4bcdd5f36298aa332b5f5 |