Skip to main content

The Opentrons API is a simple framework designed to make writing automated biology lab protocols easy.

Project description

The Opentrons API is a simple framework designed to make it easy to write automated biology lab protocols for Opentrons robots.

This package can be used to simulate protocols on your computer without connecting to a robot. Please refer to our Full API Documentation for detailed instructions on how to write and simulate your first protocol.

This package is now for use with the Opentrons Flex and Opentrons OT-2 only. For the software needed to run an Opentrons OT-One, please see versions.

Simulating Protocols

To simulate a protocol using this package, you can use the console script opentrons_simulate, which is installed when this package is installed from pip. For detailed information on how to run the script, run opentrons_simulate --help. In general, however, simulating a protocol is as simple as running opentrons_simulate.exe C:\path\to\protocol on Windows or opentrons_simulate /path/to/protocol on OSX or Linux.

The simulation script can also be invoked through python with python -m opentrons.simulate /path/to/protocol.

This also provides an entrypoint to use the Opentrons simulation package from other Python contexts such as an interactive prompt or Jupyter. To simulate a protocol in python, open a file containing a protocol and pass it to opentrons.simulate.simulate:

import opentrons.simulate
protocol_file = open('/path/to/protocol.py')
opentrons.simulate.simulate(protocol_file)

The function will either run and return or raise an exception if there is a problem with the protocol.

Configuration

The module has a lot of configuration, some of which is only relevant when running on an actual robot, but some of which could be useful during simulation. When the module is first imported, it will try and write configuration files in ~/.opentrons/config.json (C:\Users\%USERNAME%\.opentrons\config.json on Windows). This contains mostly paths to other configuration files and directories, most of which will be in that folder. The location can be changed by setting the environment variable OT_API_CONFIG_DIR to another path. Inividual settings in the config file can be overridden by setting environment variables named like OT_API_${UPPERCASED_VAR_NAME} (for instance, to override the serial_log_file config element you could set the environment variable OT_API_SERIAL_LOG_FILE to a different path).

Note On Versions

This API is for locally simulating protocols for the Flex or OT-2 without connecting to a robot. It no longer controls an OT-One.

Version 2.5.2 was the final release of this API for the OT-One. If you want to download this API to use the OT-One, you should download it with

pip install opentrons==2.5.2

For APIs between 2.5.2 and 3.7.0, there is no PyPI package available. Those APIs should be installed by cloning this repo and following the instructions in the Development Setup section of CONTRIBUTING.md and the API readme.

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

opentrons-7.2.0a6.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opentrons-7.2.0a6-py2.py3-none-any.whl (1.4 MB view details)

Uploaded Python 2Python 3

File details

Details for the file opentrons-7.2.0a6.tar.gz.

File metadata

  • Download URL: opentrons-7.2.0a6.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.13

File hashes

Hashes for opentrons-7.2.0a6.tar.gz
Algorithm Hash digest
SHA256 5a41f24b0beb8b81fdafc1cfb251637935a5609891952232030fa8f34cf99d34
MD5 6cf59a44438ee5d54f72a7431647e7e3
BLAKE2b-256 dc02f3e721e0881ef7b0eb8eb1fba72e1f5f1477274a4abb6e40525abbcde6da

See more details on using hashes here.

File details

Details for the file opentrons-7.2.0a6-py2.py3-none-any.whl.

File metadata

  • Download URL: opentrons-7.2.0a6-py2.py3-none-any.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.13

File hashes

Hashes for opentrons-7.2.0a6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 be88f3be74707a71221b938be334eb82e9c72cfe81f8778390eda27b82f67427
MD5 eed9f91377938b687ae08a55088ceb72
BLAKE2b-256 3f596c230a3f15015551e8fb62b8f4b73beabe056bc2919f6a8c68fee6e6dc14

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page