Typed Python SDK for the Wokwi Simulation API with both async and synchronous interfaces
Project description
Wokwi Python Client 🚀
Typed Python SDK for the Wokwi Simulation API with both async and synchronous interfaces
TL;DR: Run and control your Wokwi simulations from Python with first-class type hints, zero boilerplate, and both async and synchronous APIs.
Wokwi is a platform for creating and running simulations of electronic circuits and embedded systems. It supports a wide range of hardware platforms, including ESP32 family, Arduino, Raspberry Pi, STM32 and more.In addition, it supports a wide range of peripherals, including sensors, displays, motors, and debugging tools.
Wokwi Python Client is a Python SDK for the Wokwi Simulation API. It provides two client interfaces:
WokwiClient: Async client with full asyncio support for modern Python applicationsWokwiClientSync: Synchronous client that mirrors the async API for traditional blocking code
Both clients allow you to run and control your Wokwi simulations from Python in a typed, easy-to-use way. You can use them to automate your embedded testing and development workflows.
Installation requirements
- Python ≥ 3.9
- An API token from https://wokwi.com/dashboard/ci.
Install the library with:
pip install wokwi-client
Running the examples
Async Example
The basic async example is in the examples/hello_esp32/main.py file. It shows how to:
- Connect to the Wokwi Simulator
- Upload a diagram and firmware files
- Start a simulation
- Monitor serial output asynchronously
You can run the async example with:
pip install -e .[dev]
python -m examples.hello_esp32.main
Sync Example
The synchronous example is in the examples/hello_esp32_sync/main.py file. It demonstrates the same functionality using the blocking WokwiClientSync:
pip install -e .[dev]
python -m examples.hello_esp32_sync.main
ESP-IDF Example
The ESP-IDF example is in the examples/hello_esp32_idf/main.py file. It demonstrates uploading ESP-IDF firmware using flasher_args.json:
pip install -e .[dev]
python -m examples.hello_esp32_idf.main
For more examples, see the examples directory.
Documentation
The API documentation is available at https://wokwi.github.io/wokwi-python-client/.
Development
To run the tests, set the WOKWI_CLI_TOKEN environment variable (you can get a token from https://wokwi.com/dashboard/ci) and run the following command:
hatch run dev:pytest
To run the linter, run the following command:
hatch run ruff format --check .
hatch run ruff check .
To run the type checker, run the following command:
hatch run mypy .
Creating a new release
To create a new release, run the following commands:
git tag -m "v0.0.6" v0.0.6
git push --follow-tags
Replace 0.0.6 with the new version number.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
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 wokwi_client-0.4.0.tar.gz.
File metadata
- Download URL: wokwi_client-0.4.0.tar.gz
- Upload date:
- Size: 23.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97f4530674c5be551147a2f6eb08912455d9fa11b16243ca1abf78bd5493fa68
|
|
| MD5 |
6826a34b2da5ebbdfe54aa57cc40dfab
|
|
| BLAKE2b-256 |
51dcd8d81ce94a34eb60dbf1cc52169921a595832ba343e52a56040e104f66fe
|
Provenance
The following attestation bundles were made for wokwi_client-0.4.0.tar.gz:
Publisher:
release.yaml on wokwi/wokwi-python-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wokwi_client-0.4.0.tar.gz -
Subject digest:
97f4530674c5be551147a2f6eb08912455d9fa11b16243ca1abf78bd5493fa68 - Sigstore transparency entry: 969170918
- Sigstore integration time:
-
Permalink:
wokwi/wokwi-python-client@419d9d45cac33e464fc6f082b98768f90f2fbebb -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/wokwi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@419d9d45cac33e464fc6f082b98768f90f2fbebb -
Trigger Event:
push
-
Statement type:
File details
Details for the file wokwi_client-0.4.0-py3-none-any.whl.
File metadata
- Download URL: wokwi_client-0.4.0-py3-none-any.whl
- Upload date:
- Size: 27.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cad74b8e968c87550d96396b946db78c1ee3e5ad013e1c82563f830f19be2b6
|
|
| MD5 |
884cd863296ed0840f42c422eb3b30bb
|
|
| BLAKE2b-256 |
86274ffc1631bdb173602c33efaddd4eacb1efbe6323aa8e1309b98cf97f7f36
|
Provenance
The following attestation bundles were made for wokwi_client-0.4.0-py3-none-any.whl:
Publisher:
release.yaml on wokwi/wokwi-python-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wokwi_client-0.4.0-py3-none-any.whl -
Subject digest:
5cad74b8e968c87550d96396b946db78c1ee3e5ad013e1c82563f830f19be2b6 - Sigstore transparency entry: 969171000
- Sigstore integration time:
-
Permalink:
wokwi/wokwi-python-client@419d9d45cac33e464fc6f082b98768f90f2fbebb -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/wokwi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@419d9d45cac33e464fc6f082b98768f90f2fbebb -
Trigger Event:
push
-
Statement type: