HardLabs SDK for Python
Run your tests against a HardLabs simulation of your board, running the firmware you'd flash: its console, its inputs, the values it reports, and its serial ports.
Documentation: https://www.hardlabs.io/docs/sdk/python
pip install "hardlabs-sdk[test]"
npx hardlabs login # once per computer; in CI, set HARDLABS_TOKEN instead
from hardlabs_sdk import Client
with Client().start("company_name/board_name", "build/app.elf") as board:
board.wait_for("app ready", within=5) # simulated seconds
board.do("bench-supply.volts", 11.5)
assert board.read("power-monitor.bus-current") < 0.2
With pytest:
def test_overheat_raises_the_alarm(hardlabs_board):
hardlabs_board.do("temperature-sensor-mcp9808.overheat-75-c")
hardlabs_board.wait_for("ALARM", within=5)
pytest --hardlabs-sim hardlabs/demo-board
- Quickstart
- Using your own test framework over the board's serial ports
- API reference
Each request the SDK makes tells HardLabs which SDK function made it (for
example Board.wait_for) and a random id for the run, so we can see how the
SDK is used; set HARDLABS_TELEMETRY=0 or DO_NOT_TRACK=1 to leave them out.
See the privacy policy.
Metadata
Release files for hardlabs-sdk 0.6.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 |
|---|---|---|---|---|
| hardlabs_sdk-0.6.0.tar.gz | 56.8 kB | Without provenance | Details for hardlabs_sdk-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hardlabs_sdk-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for hardlabs_sdk-0.6.0-py3-none-any.whl |
Total release size: 105.1 kB
Release files / hardlabs_sdk-0.6.0.tar.gz
| Download URL | hardlabs_sdk-0.6.0.tar.gz |
|---|---|
| Size | 56.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8e7e026f158baeb7624ab4802dfba889a6722c6469c7edd06fd3b4b4f8955e59
|
|
BLAKE2b-256 checksum How to use checksums |
171b94d0d5fa8b0fe8d40bbf947d7dc8e922a426b55619b590bd39c7ca10cdf8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Release files / hardlabs_sdk-0.6.0-py3-none-any.whl
| Download URL | hardlabs_sdk-0.6.0-py3-none-any.whl |
|---|---|
| Size | 48.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cd4ded663c7dfa4e16cb88db6d2b24d384e12e3f932d540916131bde7632e008
|
|
BLAKE2b-256 checksum How to use checksums |
ac460589927860f141a5140903fe487e77c71b73b5127c858dff3e3bb4c08365
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Security for hardlabs-sdk 0.6.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.