Typed, async-first Python bindings for the full OpenOCD command surface
Project description
openocd-python
Typed, async-first Python bindings for the full OpenOCD command surface.
Install
pip install openocd-python
Quick Start
from openocd import Session
# Connect to a running OpenOCD instance
async with Session.connect() as ocd:
state = await ocd.target.halt()
pc = await ocd.registers.pc()
mem = await ocd.memory.read_u32(0x08000000, 4)
print(f"PC: {pc:#x}")
# Or spawn OpenOCD and connect
async with Session.start("interface/cmsis-dap.cfg -f target/stm32f1x.cfg") as ocd:
await ocd.target.halt()
regs = await ocd.registers.read_all()
# Synchronous API available too
with Session.start_sync("interface/cmsis-dap.cfg") as ocd:
ocd.target.halt()
print(f"PC: {ocd.registers.pc():#x}")
Features
- Async-first with sync wrappers for every method
- Typed returns — dataclasses, not raw strings
- Full OpenOCD surface: target control, memory, registers, flash, JTAG, breakpoints, RTT
- SVD decoding — read a peripheral register and get named bitfields
- Process management — spawn and manage OpenOCD subprocesses
- Dual transport — TCL RPC (primary) and telnet (fallback)
Requirements
- Python 3.11+
- OpenOCD installed and on PATH (or pass
openocd_bin=)
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
openocd_python-2026.2.17.tar.gz
(66.7 kB
view details)
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 openocd_python-2026.2.17.tar.gz.
File metadata
- Download URL: openocd_python-2026.2.17.tar.gz
- Upload date:
- Size: 66.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"EndeavourOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03dd1dd94e94659f40b5f4d9ae6722f843cc4b702ad3d3802b57f841a7a14584
|
|
| MD5 |
9366fe2a650c886941485597ca5d02ff
|
|
| BLAKE2b-256 |
5aeaf4176c73012aa91e9e8dc937cdaaadfc053d54226e6e291508b8f60ef5e3
|
File details
Details for the file openocd_python-2026.2.17-py3-none-any.whl.
File metadata
- Download URL: openocd_python-2026.2.17-py3-none-any.whl
- Upload date:
- Size: 49.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"EndeavourOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09c64c8594e40c66c2ed7391f9d89d784701e29b5c7e13343ee8a5339a3b283c
|
|
| MD5 |
740d0c52df5e1b1900a61c38dde52055
|
|
| BLAKE2b-256 |
b5fe9200e6357320f6a913c91536105b8cac0933404a3fca86563b3561c92c42
|