DPEA_DPi
Python drivers for the DPEA Pi family of circuit boards developed by Stan Reifel.
Installation
Add the package to an exhibit project:
uv add dpeaDPi
On the DPEA Raspberry Pi image, this also installs rpi-lgpio, which provides
the RPi.GPIO module used by DPiComputer. The image includes the native build
dependencies required by lgpio on Python 3.13.
RS485 drivers do not open /dev/serial0 when they are imported or constructed.
The default shared network opens it when the first command is sent. Tests and
applications can pass a configured DPiNetwork or another compatible network
object into a board constructor. The package does not automatically select a
simulated hardware backend.
DPiComputer also initializes GPIO and I2C on first use. Its constructor accepts
compatible gpio and i2cBus objects for integration tests.
Testing without hardware
There are three separate layers for running without physical boards. Pick the one that matches what you are doing.
-
Low-level injection (for this package's own tests). Every driver accepts an injected transport or backend:
DPiNetwork(serialPort=...)for the RS485 boards, andDPiComputer(gpio=..., i2cBus=...)for GPIO and I2C. This exercises packet and pin behavior. Consumers should not need to emulate packets or pins. -
Board simulation (for consumer applications and tests). The
dpeaDPi.simulationpackage provides aSimulatedDPiXxxfor each board with the same public methods as the real driver, so application code runs unchanged against either. Simulated physical input (button presses, sensor changes, motion completion) is driven through a separate.controlsobject. The simulators use no serial, GPIO, I2C, real sleeps, or threads, and one injectedSimClockgives deterministic timing.from dpeaDPi.simulation import SimState, SimulatedDPiButton state = SimState() button = SimulatedDPiButton(state=state) button.controls.press(0) assert button.readRGBButtonLatch(0) == (True, True) state.fail_next("button", "readRGBButtonLatch") assert button.readRGBButtonLatch(0) == (False, False)
Import the simulators explicitly. Nothing is auto-selected based on the operating system, and the real drivers never import this package.
-
Consumer composition (for structuring an exhibit). Choose real or simulated hardware once, at the application's composition root, and keep the decision out of business logic. See
DPi_Examples/consumer_backendfor a complete reference,DPi_Examples/simulationsfor runnable simulated board examples and consumer-side tests, andDPi_Examplesfor board, application, and diagnostic examples that all run against real or simulated hardware.
Development
Install the locked project and development dependencies:
uv sync --locked --all-groups
Run the tests and build both package distributions:
uv run --locked pytest
uv build --no-sources
Project metadata, runtime dependencies, and the next release version live in
pyproject.toml. uv.lock is committed for reproducible development and CI.
Releases
Merging a new package version into main runs the full test and package checks.
CI creates a tag such as v1.0.0 from the version in pyproject.toml, then
publishes the exact artifacts to PyPI with Trusted Publishing. No manual tag or
PyPI upload is required.
Configure the PyPI trusted publisher once with these values:
- Owner:
dpengineering - Repository:
DPEA_DPi - Workflow:
publish.yml - Environment:
pypi
No PyPI token is stored in GitHub.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dpeadpi-1.2.0.tar.gz.
File metadata
- Download URL: dpeadpi-1.2.0.tar.gz
- Upload date:
- Size: 53.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90346c0febb9525c53c86405e0c1c6f63d1d848a13b3c4ed83232a2bce3ac652
|
|
| MD5 |
5b4d28550878a8fa3b7f00417b5d55ff
|
|
| BLAKE2b-256 |
95f76ba15b6d21e177e594e3b6fe0beede43341b75bc4354ea648fe17076368e
|
Provenance
The following attestation bundles were made for dpeadpi-1.2.0.tar.gz:
Publisher:
publish.yml on dpengineering/DPEA_DPi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dpeadpi-1.2.0.tar.gz -
Subject digest:
90346c0febb9525c53c86405e0c1c6f63d1d848a13b3c4ed83232a2bce3ac652 - Sigstore transparency entry: 2760815094
- Sigstore integration time:
-
Permalink:
dpengineering/DPEA_DPi@6e3f94ae364dc920e930ea7a1af32e11db77ef2e -
Branch / Tag:
refs/tags/v1.2.0 - Owner: https://github.com/dpengineering
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6e3f94ae364dc920e930ea7a1af32e11db77ef2e -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file dpeadpi-1.2.0-py3-none-any.whl.
File metadata
- Download URL: dpeadpi-1.2.0-py3-none-any.whl
- Upload date:
- Size: 71.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8156448772ff17cc84e6b0b3e06b0fd68ee291b961b49851e658a56c4648464
|
|
| MD5 |
96f5426cb25bf35e69848bf4bb87e261
|
|
| BLAKE2b-256 |
93c08a78e6004fa4fbc2b516c3073bd0acc702f784e335b298c2d22059aad0a1
|
Provenance
The following attestation bundles were made for dpeadpi-1.2.0-py3-none-any.whl:
Publisher:
publish.yml on dpengineering/DPEA_DPi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dpeadpi-1.2.0-py3-none-any.whl -
Subject digest:
c8156448772ff17cc84e6b0b3e06b0fd68ee291b961b49851e658a56c4648464 - Sigstore transparency entry: 2760815122
- Sigstore integration time:
-
Permalink:
dpengineering/DPEA_DPi@6e3f94ae364dc920e930ea7a1af32e11db77ef2e -
Branch / Tag:
refs/tags/v1.2.0 - Owner: https://github.com/dpengineering
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6e3f94ae364dc920e930ea7a1af32e11db77ef2e -
Trigger Event:
workflow_dispatch
-
Statement type: