pydevicetree
A library for parsing Devicetree Source v1
What it is and what it does
pydevicetree is a Python library for working with Devicetree Source (DTS) files, the standard format for describing hardware device configurations in embedded systems and firmware. It parses .dts files into an in-memory tree structure, then provides methods to query nodes by compatible string or path, retrieve and modify properties, and convert trees back to DTS format. The library depends only on pyparsing and supports Python 3.5 and later.
The package is primarily useful for embedded systems developers, firmware engineers, and hardware abstraction layer (HAL) developers who need to programmatically inspect or generate device tree configurations. Common operations include finding nodes by device type, extracting register addresses and memory ranges, and accessing device properties like interrupt configurations or clock frequencies. It handles Devicetree Specification v0.2 and supports standard DTS syntax including aliases, chosen nodes, and hierarchical device definitions.
Use it for:
- Automated validation of hardware device tree configurations in CI/CD pipelines for embedded projects.
- Programmatic extraction of register addresses and memory mappings from .dts files for code generation.
- Runtime modification of device tree properties to support dynamic hardware reconfiguration or testing.
- Querying device compatibility strings to identify and configure specific hardware peripherals in firmware.
- Converting between devicetree formats or generating device tree fragments from other configuration sources.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses, queries, and modifies Devicetree Source v1 files according to the Devicetree Specification v0.2, enabling programmatic access to hardware device configurations.
Yes, if you work with Devicetree Source files in embedded systems or firmware development. The package has low install friction, permissive licensing, and no known vulnerabilities. However, note that maintenance is aging—the last release was over two years ago—so consider whether you need active development support or can work with a stable, feature-complete implementation for DTS parsing and querying.
Install
pydevicetree on PyPI
pip
pip install pydevicetreeuv
uv add pydevicetreepoetry
poetry add pydevicetreeInstalling pydevicetree
Before you install
Low install friction with a single runtime dependency (pyparsing). Maintenance status is aging—last release was 2023-07-21 and the repository has not been updated since 2025-07-24, though it remains active and unarchived.
License in practice
Licensed under Apache License 2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions.
Quickstart
pip install pydevicetree
from pydevicetree import Devicetree
tree = Devicetree.parseFile("design.dts")
matches = tree.match("sifive,rocket0")
node = tree.get_by_path("/soc/uart@10000000")
Requires Python >= 3.5; the package is designed for parsing .dts files conforming to Devicetree Specification v0.2.
Verify before relying
- Whether the package handles Devicetree Specification versions beyond v0.2 or only v0.2 strictly.
- Performance characteristics when parsing large or deeply nested devicetree files.
- Whether modifications to trees are persisted back to .dts files or remain in-memory only.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.5) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pyparsing |
| Maintenance | aging — 1,120 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 80,338/month — #14,297 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pydevicetree-0.0.13-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
devicetreeProvides Python libraries for parsing and…
permissive · top 15,000 on PyPI
fdtParses, manipulates, and converts between…
permissive · top 15,000 on PyPI
pyslangpyslang provides Python bindings to parse,…
permissive · top 15,000 on PyPI
pyftdiPyFtdi provides a pure-Python user-space driver…
permissive · top 15,000 on PyPI
crownstone-uartPython library for controlling Crownstone smart…
unclear · top 15,000 on PyPI
rosdistroParses and manipulates ROS distribution…
permissive · top 15,000 on PyPI
pylspciParses the output of the lspci command to…
copyleft · top 15,000 on PyPI
uart-devicesProvides a Python interface to interact with…
permissive · top 15,000 on PyPI
xdg-base-dirsProvides functions to retrieve XDG Base…
permissive · top 15,000 on PyPI
RPi.GPIORPi.GPIO provides Python control over Raspberry…
permissive · top 15,000 on PyPI