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.7.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 hardlabs-sdk 0.7.0
File Size Uploaded Provenance Actions
hardlabs_sdk-0.7.0.tar.gz 61.4 kB Without provenance Details for hardlabs_sdk-0.7.0.tar.gz

Built distribution (wheel)

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

Total release size: 113.0 kB

Release files / hardlabs_sdk-0.7.0.tar.gz

Download URL hardlabs_sdk-0.7.0.tar.gz
Size 61.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6de210d4e29c4fc4f638fe215b35d011a26471edff8619c4e5f292eaf2a460fd
BLAKE2b-256 checksum
How to use checksums
e6e732a6773054a9b4fcaecb5f852965ddec4d516bd3eac2b9d95eb428390ca1
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.7.0-py3-none-any.whl

Download URL hardlabs_sdk-0.7.0-py3-none-any.whl
Size 51.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7599b5c947bfb0a1e5b2e476b06553ee8ddf1d3d989f15135ad38413502c1acb
BLAKE2b-256 checksum
How to use checksums
320d2eb7b881d755a89069786f5f7964e5e3c197dc94596135ed98aecfaa24ce
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.7.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.

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