Skip to main content

labwired (Python)

Run microcontroller firmware in the LabWired simulator and test it with pytest. Time is virtual: execution advances only inside run_for and expect.

Install

pip install labwired

Wheels are abi3: one wheel per platform covers CPython 3.9 and newer (Linux x86_64/aarch64, macOS arm64/x86_64, Windows x64).

Test firmware with pytest

The package installs a pytest plugin with a sim fixture:

def test_boot_banner(sim):
    with sim("firmware.elf", chip="stm32f103") as s:
        s.expect(r"boot ok", timeout="10ms")
        s.send("ping\n")
        assert s.expect("pong", timeout="5ms").text == "pong"

Run it with pytest. Give --labwired-chip <name> to set a default chip for every sim(...) call. On a failure, the report shows the UART transcript.

Test a drawing

Sim(elf, diagram="board.json") runs the diagram you drew in the playground (or an agent wrote): the parts, the wires, the analog circuit, the bench instruments. The diagram is lowered by labwired-lower, the compiler the playground and the hosted API use, so there is no second copy to drift.

import labwired

with labwired.Sim("capacitive-touch-lab.elf", diagram="diagram.json") as board:
    board.watch("D13")                          # a pin the drawing wires
    board.run_for("0.4s")
    board.set_signal("ui.touch.pressed", True)  # a finger on the pad
    board.run_for("0.4s")
    print(board.read_uart(), board.edges())     # console, and the LED's level changes
    print(board.meters())                       # multimeter readings, as in the playground

A diagram with several MCUs returns a World; elf is then a mapping from part id to ELF:

with labwired.Sim({"mcu": "stm.elf", "avr": "avr.elf"}, diagram="two-boards.json") as world:
    world.run_for("30ms")
    world.machine("avr").uart_transcript()
    world.net("mcu.PB4")["edges"]               # every GPIO net between the chips

On a Sim and on each world.machine(id): watch(*pads) and edges() (level changes with the cycle and time), read_uart, expect, set_input, set_pin. A Sim also has set_signal(path, value) (a signal of the analog island), analog_trace() (the CSV labwired test --analog-trace writes) and meters(). world.nets() reports every GPIO net: level, edge count, members, contention. A pad is a pin the diagram wires ("PB4"), "gpiob:4", or a (peripheral, pin) pair.

Needs Node.js 20 or newer for the lowering. labwired-lower is found on PATH, else run as npx -y --package=@labwired/board-config@<version> labwired-lower. The wheel records the version it was tested with, and the tool's major.minor must match. Without Node the call fails with one message that says how to install it. It never falls back to a hosted service: your design is not sent anywhere. Set LABWIRED_LOWER to use a labwired-lower you already have.

One chip descriptor override is sometimes needed: a lab whose firmware was built for silicon other than the drawn board (gpio-net-two-boards drawn as a G071 Nucleo, firmware for a G0B1) takes chip_yaml={"mcu": "stm32g0b1re.yaml"}.

Limits: an analog island needs one MCU (worlds do not run co-simulation models yet), and a world's pads report edges by cycle on each node's own clock.

API summary

  • Sim(elf, chip=... | system=..., uart=None): one ELF on one machine.
  • run_for(duration), expect(pattern, timeout): advance virtual time.
  • read_uart() returns text (invalid UTF-8 becomes U+FFFD). read_uart_bytes() returns the raw bytes.
  • send(text), send_bytes(data), read_u32, write_u32, read_memory, snapshot(), restore(snap), set_input, set_pin, frames().
  • run_firmware(elf, chip=..., duration="1s", expect=...): one-shot helper.

Metadata

Release files for labwired 0.26.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 labwired 0.26.0
File Size Uploaded Provenance Actions
labwired-0.26.0.tar.gz 16.4 MB With provenance Details for labwired-0.26.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for labwired 0.26.0
File Actions
labwired-0.26.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for labwired-0.26.0-cp39-abi3-win_amd64.whl
labwired-0.26.0-cp39-abi3-manylinux_2_28_x86_64.whl CPython 3.9 abi3 Linux glibc 2.28+ x86-64 Details for labwired-0.26.0-cp39-abi3-manylinux_2_28_x86_64.whl
labwired-0.26.0-cp39-abi3-manylinux_2_28_aarch64.whl CPython 3.9 abi3 Linux glibc 2.28+ ARM64 Details for labwired-0.26.0-cp39-abi3-manylinux_2_28_aarch64.whl
labwired-0.26.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for labwired-0.26.0-cp39-abi3-macosx_11_0_arm64.whl
labwired-0.26.0-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for labwired-0.26.0-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 88.7 MB

Release files / labwired-0.26.0.tar.gz

Download URL labwired-0.26.0.tar.gz
Size 16.4 MB
Tags Source
SHA-256 checksum
How to use checksums
40f195ad4eff5f81453514c6dd35d148c3c0de3fa8f098eeeca78a8b6b06595c
BLAKE2b-256 checksum
How to use checksums
4807bcd51f6f04241722f209fbadc7750b279fcae60560c799034a5ee29944ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 15, 2026.

Transparency log

Release files / labwired-0.26.0-cp39-abi3-win_amd64.whl

Download URL labwired-0.26.0-cp39-abi3-win_amd64.whl
Size 14.3 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
3fa81934a45cfac1d3dfd6c2278ff2274e564183e436d210460fb59fefba11ff
BLAKE2b-256 checksum
How to use checksums
1bba01d575a2f10b61cd99f2290b940619338e2233ce495604a3ea40dcba3257
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 15, 2026.

Transparency log

Release files / labwired-0.26.0-cp39-abi3-manylinux_2_28_x86_64.whl

Download URL labwired-0.26.0-cp39-abi3-manylinux_2_28_x86_64.whl
Size 15.1 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
7abc32478aa94934d4f1ed46ba064d95670a476404fa9cd3d8b444d4a50ab2b4
BLAKE2b-256 checksum
How to use checksums
14b981442094bd7e4a266edb38b72e14579dbfe7f450d5122f5da89f110159d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 15, 2026.

Transparency log

Release files / labwired-0.26.0-cp39-abi3-manylinux_2_28_aarch64.whl

Download URL labwired-0.26.0-cp39-abi3-manylinux_2_28_aarch64.whl
Size 14.7 MB
Tags CPython 3.9 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
654f95cd9a7937f98e04e93965837c070be29ca42200fd98a1f4c29d05883950
BLAKE2b-256 checksum
How to use checksums
cb9eb0b9b803e85ecfd4c043f9bb81b8088c84527681da96f96a2bd3553707db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 15, 2026.

Transparency log

Release files / labwired-0.26.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL labwired-0.26.0-cp39-abi3-macosx_11_0_arm64.whl
Size 13.7 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7cb3e0ba7c53fe8c7c3f4f1ee5d3e16611ead7d3b630e5983b86d55c8b9c45a9
BLAKE2b-256 checksum
How to use checksums
7fc3fe78df454d32571a69860dfb73fc464b8a304b596a8a7d917d96b78cfe3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 15, 2026.

Transparency log

Release files / labwired-0.26.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL labwired-0.26.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 14.4 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
4ac88d10bbb013c89631e913505018b1203f1bd4785e0037ac17935196d1a720
BLAKE2b-256 checksum
How to use checksums
58c0f31b3c6bbf3288e22b3f0fe86269e3877954409d7170bc6fa159565f114b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 15, 2026.

Transparency log

Security for labwired 0.26.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 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for labwired-0.26.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 Nov 15, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.26.0 This release

6 release files Full provenance

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