Puzzlepiece Hardware (pzp-hardware)
Laboratory hardware support Pieces for the puzzlepiece GUI & automation framework.
Puzzlepiece is a GUI-forward Python framework for automating experimental setups and rapid user interface creation. You can find its documentation and tutorial at https://puzzlepiece.readthedocs.io. This library provides “Pieces” (GUI components) for commonly used laboratory hardware, so that you can easily assemble your automation application (a “Puzzle”) out of them.
Documentation: https://pzp-hardware.readthedocs.io
Repository: https://github.com/jdranczewski/pzp-hardware
Installation
You can install this package from pip:
pip install pzp-hardware
If you would like to develop your own Pieces and contribute changes to this library, you may choose to clone the repository instead, and install a local, editable copy:
git clone https://github.com/jdranczewski/pzp-hardware.git cd pzp-hardware pip install -e .
Once installed, you can use the Pieces provided like you would any other Piece in puzzlepiece:
import puzzlepiece as pzp
from puzzlepiece.extras import hardware_tools as pht
from pzp_hardware.thorlabs import camera, apt_stage
# Create a Qt app, the backend that will run our GUI
app = pzp.QApp()
# Create a Puzzle, the main window of the application.
# We prompt the user whether they want to launch in debug mode, which doesn't talk to hardware.
# We use the Puzzle as a context manager, so that if any of the Pieces raise exceptions while
# being added, the Puzzle can clean up other APIs and exit cleanly.
with pzp.Puzzle(name="Test", debug=pht.debug_prompt()) as puzzle:
puzzle.add_piece("camera", camera.Piece, row=0, column=0)
puzzle.add_piece("stage", apt_stage.Piece, row=0, column=1, param_defaults={
"serial": 1234 # you can provide default values for the params during setup
})
# Display the Puzzle and execute the Qt app
puzzle.show()
app.exec()
Check out Getting started for more details!
Structure
The library consists of a number of manufacturer folders, each containing Python files that each interface with a specific hardware/software provided by that manufacturer. The library contains all files on installation, but they need to be specifically imported, so that you never have to import the full library, just the parts you require:
from pzp_hardware.thorlabs import camera, apt_stage from pzp_hardware.vialux import dmd
See Modules for all currently supported hardware.
Development and contributing
Puzzlepiece provides a unified API for all of your devices, so the best laboratory automation experience is if you have Pieces for all of your hardware. If your hardware is not supported by pzp-hardware, you can create a Piece yourself – puzzlepiece aims to make that as easy as possible! You can create a fork of the main repository, install it locally as shown above to allow development, and we welcome pull requests adding support for new hardware.
Your Piece should broadly follow the same conventions as the ones currently in the repository. For example, image-based Pieces like cameras, DMDs, or SLMs should have an image param, allowing you to use the standard preview layouts provided in pzp_hardware.generic.mixins.image_preview. Your Piece should work reliably in debug mode to allow testing. You can use puzzlepiece.extras.hardware_tools to make integration with manufacturer APIs and DLLs easier, and in particular you should indicate requirements specific to your Piece with puzzlepiece.extras.hardware_tools.requirements (these are automatically parsed to appear in this documentation).
Documentation is key to your users being able to find, install, and use the Piece. Pull requests that don’t include at least basic documentation for the new Piece will not be merged. Documentation should be included in your Piece’s Python file, mostly as a docstring at the top, with docstrings in the Pieces that you want exposed in the docs. It’s also recommended to include a screenshot of your Piece, but an explicit list of params is not required, as the user can inspect this in debug mode. Check out the Piece file template on GitHub .
Metadata
Release files for pzp-hardware 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pzp_hardware-0.3.0.tar.gz | 1.2 MB | With provenance | Details for pzp_hardware-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pzp_hardware-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for pzp_hardware-0.3.0-py3-none-any.whl |
Total release size: 1.2 MB
Release files / pzp_hardware-0.3.0.tar.gz
| Download URL | pzp_hardware-0.3.0.tar.gz |
|---|---|
| Size | 1.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
67fc019fbb3df943e686ed94d029715d86dc5646404219ef2440cfacaf41be15
|
|
BLAKE2b-256 checksum How to use checksums |
12bc91460956d0973669c8ddff462b2af16914cfa2c9980f21e221a7751697ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 18, 2026.
Transparency logRelease files / pzp_hardware-0.3.0-py3-none-any.whl
| Download URL | pzp_hardware-0.3.0-py3-none-any.whl |
|---|---|
| Size | 57.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7faff0b5163627b6fc4951c2b4c58603caee9d9f4dbd760b2e3891690f74f9b2
|
|
BLAKE2b-256 checksum How to use checksums |
c1b145990136762e25adf4a8446e0f4052de675f4322ec72953d2b6da98be775
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 18, 2026.
Transparency logSecurity for pzp-hardware 0.3.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.
Attestation for pzp_hardware-0.3.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 May 18, 2026.
Transparency logA 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.