fdt
Flattened Device Tree Python Module
What it is and what it does
fdt is a Python module for working with Device Tree data structures, commonly used in embedded systems and bootloaders. It provides parsing and serialization of both binary (.dtb) and source (.dts) formats, allowing developers to read device tree configurations, modify nodes and properties, and convert between formats programmatically. The module includes a command-line tool, pydtc, for batch operations like packing, unpacking, merging, and diffing device tree files.
The package has no external runtime dependencies and supports Python 3.5 and later. It is designed for scenarios where the device tree compiler (dtc) is not available or where programmatic manipulation within Python is preferred. The API provides classes for nodes, properties (with typed variants like PropStrings, PropWords, PropBytes), and methods to search, merge, and diff tree structures.
Use it for:
- Convert binary device tree blobs (.dtb) to human-readable source format (.dts) for inspection and debugging
- Programmatically modify device tree nodes and properties in embedded system build pipelines
- Merge multiple device tree files into a single tree for complex hardware configurations
- Compare two device tree files to identify differences in node and property definitions
- Replace the device tree compiler (dtc) tool in environments where a Python-based solution is preferred
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses, manipulates, and converts between Device Tree binary (.dtb) and source (.dts) formats, with support for reading, writing, merging, and diffing device tree structures.
Yes, with conditions. Install if you need to manipulate device trees programmatically in Python and can accept dormant maintenance (last release 2022-07-08). The package is stable, dependency-free, and carries no known vulnerabilities, making it suitable for embedded systems work where active development is not expected. Avoid if you require ongoing feature development or support for Python versions beyond 3.10.
Install
fdt on PyPI
pip
pip install fdtuv
uv add fdtpoetry
poetry add fdtInstalling fdt
Before you install
Low install friction with no runtime dependencies. Maintenance is dormant—last release was 2022-07-08, over 1498 days ago, though the repository remains active with a recent commit on 2024-09-22. Suitable for stable, embedded-systems use cases where active development is not expected.
License in practice
Licensed under Apache 2.0 (permissive), allowing commercial and private use with minimal restrictions. No notable licensing constraints for typical adoption.
Quickstart
import fdt
with open('example.dtb', 'rb') as f:
dtb_data = f.read()
dt = fdt.parse_dtb(dtb_data)
with open('example.dts', 'w') as f:
f.write(dt.to_dts())
Verify before relying
- Whether the package is actively maintained despite dormant status and 1498-day gap since last release
- Compatibility with Python versions beyond 3.10 (classifiers list 3.5–3.10 only)
Package facts
| License | Apache 2.0 (permissive) |
| Python support | supports the current Python release (>=3.5) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 1,498 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 126,594/month — #11,772 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: fdt-0.3.3-py3-none-any.whl
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
pylibfdtProvides Python bindings to libfdt, the device…
unclear · top 15,000 on PyPI
pydevicetreeParses, queries, and modifies Devicetree Source…
permissive · top 15,000 on PyPI
bitstructPacks and unpacks Python values into bit-level…
permissive · top 5,000 on PyPI
hepconverthepconvert converts between columnar file…
permissive · top 15,000 on PyPI
cbitstructA C-accelerated implementation of the bitstruct…
copyleft · top 15,000 on PyPI
pyubx2Parses and generates UBX protocol messages from…
permissive · top 15,000 on PyPI
hexrecLoads, edits, and saves hexadecimal record…
permissive · top 15,000 on PyPI
jxmleaseConverts XML to Python data structures (lists,…
permissive · top 15,000 on PyPI
x690Encodes and decodes data using the X.690 BER…
permissive · top 15,000 on PyPI
plum-pyTransforms byte sequences into Python objects…
permissive · top 15,000 on PyPI