Skip to main content

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

sterns1 EtienneThompson

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)

Uploaded Source

Built Distribution

ua_ilab_tools-2.1.1-py3-none-any.whl (11.7 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