Skip to main content

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

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.8.1

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

Source distribution (sdist)

Source distribution for hardlabs-sdk 0.8.1
File Size Uploaded Provenance Actions
hardlabs_sdk-0.8.1.tar.gz 62.8 kB Without provenance Details for hardlabs_sdk-0.8.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hardlabs-sdk 0.8.1
File Interpreter ABI Platform Actions
hardlabs_sdk-0.8.1-py3-none-any.whl Python 3 none any Details for hardlabs_sdk-0.8.1-py3-none-any.whl

Total release size: 115.3 kB

Release files / hardlabs_sdk-0.8.1.tar.gz

Download URL hardlabs_sdk-0.8.1.tar.gz
Size 62.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1fd0722b0c661934dbe5c549d41e18ff3950fbba82d858521f36d15c75ab21c1
BLAKE2b-256 checksum
How to use checksums
e05884fc50deddffb104a9e58a03e9a9b9c2dad5c6e7e94f3e0946e19f4c0c83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.5

Release files / hardlabs_sdk-0.8.1-py3-none-any.whl

Download URL hardlabs_sdk-0.8.1-py3-none-any.whl
Size 52.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ec35593ca0c2e458983cd5b93261baee5781f03fd8fa01f04c740a1306b6ef1a
BLAKE2b-256 checksum
How to use checksums
8049375c7cf5cbd8cc840f6c537b8d5291af6333f29c536dcd922d15a109fd1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.5

Security for hardlabs-sdk 0.8.1

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.

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