Device packages
A single file is the simplest device. When a driver is used by several labs, or needs more than one file, make it a Python package. LabOrchestra installs it into an environment of its own with uv, so its libraries are resolved like any other.
The entry point
Section titled “The entry point”The package says which class is its device:
[project]name = "laborchestra-elliptec"version = "1.2"dependencies = ["laborchestra", "elliptec"]
[project.entry-points."laborchestra.devices"]elliptec = "laborchestra_elliptec:Elliptec"The name before = is the entry; the class is the same kind of class as in Write a device. By convention packages from the community are called laborchestra-<device>.
Use it
Section titled “Use it”Add a device of the kind Python package (Devices → Add device), or write it in devices.json:
{ "elliptec": { "package": "laborchestra-elliptec==1.2", "entry": "elliptec", "config": { "port": "COM4" } }}package is a requirement from PyPI, the folder of a package under development (installed editable: changes need a restart of the device), or a wheel. Installing a package runs its code on the lab PC, so install only packages whose source you trust, as with any Python package. entry may be left out when the package has only one device; python chooses the interpreter as for any device.
The dialog has a Look inside button: it builds the environment and shows the package’s devices, widgets, and the options and actions of the chosen device before you add anything.
Widgets in a package
Section titled “Widgets in a package”A package can bring the widgets for its devices. It names them in a second entry point group and ships each as a built JavaScript file:
[project.entry-points."laborchestra.widgets"]elliptec_panel = "laborchestra_elliptec.widgets"The folder of that module must hold elliptec_panel.js: an ES module with the widget as default export and meta, built from the same code as a workspace widget (react and @laborchestra/widget stay external). LabOrchestra finds them when the devices are loaded and offers them in the picker as pkg:<name>.
Publishing
Section titled “Publishing”Publish the package on PyPI like any other. There is no store of our own; a catalog that lists reviewed packages is planned on top of PyPI.
Something wrong or missing on this page? Open a GitHub issue or use the form (no account needed).