Simplified proxy API for interacting with the Waters Empower Web API.
Project description
OptiHPLCHandler
Simplified proxy API for interacting with the Waters Empower Web API.
Using the package
The package can be installed into a Python environment with the command
pip install Opti-HPLC-Handler
You can then import packge and start an EmpowerHandler
. You need to select the Empower
project to log in to. Note that the user logging in needs to have access to both that
project, and the project Mobile
.
from OptiHPLCHandler import EmpowerHandler
handler=EmpowerHandler(project="project", address="https://API_url.com:3076")
your username will be auto-detected. Add the input username
to use another account.
You will be prompted you for your password. The password will only be used to get a token from the Empower Web API. When the token runs out, you will have to input your passwrod again.
You can now get a list of the methodset methods in the project:
handler.GetMethodList()
To create a new sampleset method, first create it as a list of dicitonaries. Each
dictionary must have the keys Method
, SamplePos
, SampleName
, and
Injectionvolume
. If you want to populate oher fields, also add a key called
OtherFields
, with a value that is a list of dicts, each dict having the keys name
and value
:
sample_list = [
{
"Method": "test_method_1",
"SamplePos": "test_sample_pos_1",
"SampleName": "test_sample_name_1",
"InjectionVolume": 1,
},
{
"Method": "test_method_2",
"SamplePos": "test_sample_pos_2",
"SampleName": "test_sample_name_2",
"InjectionVolume": 2,
"OtherFields": [
{"name": "test_field_1", "value": "test_value"},
{"name": "test_field_2", "value": 2.3},
],
},
]
At the moment, only Injection Sampleset lines are supported, but the injection volume can be set to 0.
You can then use the handler to create the sampleset:
handler.PostExperiment(
sample_set_method_name="test_sampleset_method_name",
sample_list=sample_list,
plate_list=[],
audit_trail_message="test_audit_trail_message",
)
Note that plate_list
should be filled out in order to run the sampleset.
You can run a sampleset method to create a sampleset:
handler.RunExperiment(
sample_set_method="test_sampleset_method_name",
hplc = "test_hplc",
)
Getting started with developing the package
You can get the repo by cloning it from github at the URL
https://github.com/novonordisk-research/OptiHPLCHandler.git
.
If you can't clone the repo on a Windows machine, you might need to set the SSL backend.
Run the following command in a terminal:
git config --global http.sslbackend schannel
It is recommended to make and activate a virtual environment by running the following commands
pip install venv
python -m venv .env
.\.env\Scripts\activate
You need to run the last command every time you restart the computer
When the virtual environment is activated, install the package locally as an editable installation
pip install -e .[dev]
If this doesn't work, you might need to upgrade pip and/or setuptools:
.\.env\scripts\python.exe -m pip install --upgrade pip
.\.env\scripts\python.exe -m pip install --upgrade setuptools
You should then be able to install the package locally as an editable installation.
Releasing
To release a new version, update the version number in pyproject.toml
and
src\OptiHPLCHandler\__init__.py
. Make a new branch and commit the changes.
Then run the commands
python -m build
py -m twine upload dist/*
you will be prompted for your pipy.org username and password.
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
Built Distribution
Hashes for Opti_HPLC_Handler-0.2.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9275785973e64bfe028eead709d31abcb5541823fd8062e9522d53eb090a3de5 |
|
MD5 | 06f5be9e7f2fb0798d529dadceea33ed |
|
BLAKE2b-256 | 73e39bc200ad2b20db3a17cf50b1812b5487740c14ec853c77d044de4dc19511 |