Skip to main content

EduceLab Devices

educelab-devices provides Python APIs for the imaging hardware used across EduceLab projects: cameras, lights, turntables, gantries, and similar devices. Device APIs are organized by hardware type (e.g. educelab.devices.cameras, educelab.devices.lights) and are kept as simple and dependency-light as possible so they can be wrapped by any consumer (CLI scripts, Qt applications, etc.).

Installation

Install from PyPI:

pip install educelab-devices
pip install "educelab-devices[all]"   # with every PyPI-hosted backend SDK

The core package needs only numpy and includes a simulated device for every role. Each hardware backend's SDK is an optional extra, imported only when that backend is used:

Extra Backend Added by
serial MISHA, XLC lights, X-Carve (pyserial) MISHA lights track
foldio360 Foldio360 turntable (bleak) Foldio360 track
gphoto2 DSLRs over gphoto2 (not on Windows) gphoto2 camera track
acroname Acroname USB hubs (brainstem) Acroname hub track
gentl USB3 Vision cameras through a vendor GenTL producer (genicam) USB3 Vision camera track
all All of the above first driver track

Extras are declared as their driver lands. Two backends need libraries that aren't on PyPI as wheels:

  • Spinnaker cameras need PySpin: install the Spinnaker SDK, then the wheel bundled with it (the versions must match exactly).
  • USB3 Vision cameras through Aravis need Aravis 0.8 and PyGObject: on macOS, brew install aravis pkgconf cairo, then pip install pycairo followed by pip install PyGObject. See docs/hardware/usb3-vision.md for Linux.

The GenTL backend also needs the camera vendor's GenTL producer, found through GENICAM_GENTL64_PATH.

Usage

from educelab.devices.stages import SimulatedStage

with SimulatedStage() as stage:
    stage.move_to({"x": 100.0, "y": 50.0})
    print(stage.position())

See docs/guide.md for how every device behaves (lifecycle, threading, errors, events) and docs/hardware/ for what we know about each piece of hardware.

Command line

el-devices (or python -m educelab.devices) checks hardware by hand:

el-devices discover              # list devices the installed backends can find
el-devices misha                 # light each band of the attached MISHA panel
el-devices spinnaker             # benchmark the attached Spinnaker cameras
el-devices genicam --backend aravis   # ...or USB3 Vision cameras (aravis|gentl)
el-devices simulate              # exercise every simulated device
el-devices simulate stage light  # ...or only some roles
el-devices -v <command>          # log device traffic

Each driver adds a subcommand for its manual hardware check.

Development

Either pip or uv can be used.

With pip (25.1+):

python -m venv .venv
source .venv/bin/activate
pip install -e . --group dev
pytest
ruff check . && ruff format .

With uv:

uv run pytest
uv run ruff check . && uv run ruff format .

Also available:

pytest -m hardware          # tests that need real hardware attached
pytest --cov                # coverage report
mypy                        # type check (advisory in CI)

Releasing

Pushing a vX.Y.Z tag publishes that release to PyPI through .github/workflows/publish.yml, using PyPI trusted publishing (no API token).

  1. Bump version in pyproject.toml and merge it to main through a PR.
  2. Tag the merge commit and push the tag:
    git tag vX.Y.Z
    git push origin vX.Y.Z
    

The workflow fails without publishing if the tag doesn't match the version in pyproject.toml. Running it by hand from the Actions tab builds the distributions without publishing them.

Publishing needs a one-time setup: a trusted publisher for educelab-devices on PyPI (owner educelab, repository educelab-devices, workflow publish.yml, environment pypi), and a pypi environment in the GitHub repository's settings.

Project organization

  • All package code goes in src/educelab/devices, grouped into subpackages by hardware type.
  • src/educelab must not contain any files, including __init__.py files.
  • Add runtime dependencies to dependencies in pyproject.toml and development tools to [dependency-groups].
  • Tests go in tests/. Shared role contract tests are in tests/contracts/.

Metadata

Release files for educelab-devices 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for educelab-devices 0.2.0
File Size Uploaded Provenance
educelab_devices-0.2.0.tar.gz 205.9 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for educelab-devices 0.2.0
File Interpreter ABI Platform
educelab_devices-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 340.9 kB

Release files / educelab_devices-0.2.0.tar.gz

Download URL educelab_devices-0.2.0.tar.gz
Size 205.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e1e7fb2f1422d87d72bd3014cb34d368ab5927e8ce4ee8136eee98063bbc42fb
BLAKE2b-256 checksum
How to use checksums
f3145827928531d1af1f7eebdd4e0f970631c94ad4a3f4386df0b2bb9a8945af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Release files / educelab_devices-0.2.0-py3-none-any.whl

Download URL educelab_devices-0.2.0-py3-none-any.whl
Size 135.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f17156664066f1b2306040025de215605c839ceec6bf07d3ba1e11b4cfc7c30e
BLAKE2b-256 checksum
How to use checksums
ff37da36ed9e25b8bed1dfe7106cd88b1620aea057ec338e668d577d51c8f0cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Security for educelab-devices 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for educelab_devices-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page