A Python library for interacting with the Opentrons HTTP API
Project description
Opentrons Python API
Simple (and currently incomplete) Python wrapper around the Opentrons HTTP API. Like https://github.com/Opentrons/opentrons/tree/edge/api-client, but in Python. This API is atomic and interactive.
This project is created for use with PyLabRobot, but can be used however you like.
Installation
- from pip
pip install opentrons-http-api-client
- from source
git clone http://github.com/rickwierenga/opentrons-python-api
Usage
Minimal example for simple liquid handling:
import ot_api
ot_api.set_host("x.x.x.x") # find in OT app
ot_api.set_port(31950) # default, so not really necessary
# Creating a run
run_id = ot_api.runs.create()
ot_api.set_run(run_id) # set run globally, alternative to `run_id` parameter for functions
# Add pipettes that are detected in hardware to the software
left_pipette, right_pipette = ot_api.lh.add_mounted_pipettes()
left_pipette_id = left_pipette["pipetteId"]
# Defining labware
labware_def = ot_api.labware.define(labware_definition) # json from opentrons-shared-data
# Adding labware
labware_id = ot_api.labware.add(labware_def, slot=1)
# Picking up a tip
ot_api.lh.pick_up_tip(labware_id=labware_id, well_name="A1", pipette_id=left_pipette_id)
# Aspirating
ot_api.lh.aspirate(labware_id=labware_id, well_name="A1", pipette_id=left_pipette_id,
flow_rate=10, volume=10)
# Dispensing
ot_api.lh.dispense(labware_id=labware_id, well_name="A1", pipette_id=left_pipette_id,
flow_rate=10, volume=10)
# Tip drop
ot_api.lh.drop_tip(labware_id=labware_id, well_name="A1", pipette_id=left_pipette_id)
Note: the ot_api is blocking!
Notice
This project is not affiliated with Opentrons.
This project is created for the Sculpting Evolution group at the MIT Media Lab.
See LICENSE
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file opentrons_http_api_client-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: opentrons_http_api_client-0.1.5-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5136bdfe588737609f49599891aa3f67ec0067d547d9e4c782d5dda0e384a66 |
|
MD5 | 6dddca4e932771a08e25693a7afaa8aa |
|
BLAKE2b-256 | d173ebc4943a75378863ae6a9dd969d48ab0cf33fbcb635fce1e032b7e25206b |