skillfed

fdt

Flattened Device Tree Python Module

fdt v0.3.3 126.6K downloads/30d#11,772 on PyPI41
Permissive license Apache 2.0 DORMANT released

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 fdt

uv

uv add fdt

poetry

poetry add fdt

Installing 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

Environment :: ConsoleLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/EngineeringTopic :: Software Development :: Embedded SystemsTopic :: Utilities

Tags

device tree parserdtb dts converterflattened device treedevice tree manipulationembedded systems device treedtb to dts conversiondevice tree merge diff
embedded-systemsdevice-treefirmware

More Scientific/Engineering packages