{"library":"pydevicetree","title":"pydevicetree","description":"A Python library for parsing and manipulating Devicetree Source v1 (DTS) files. Current version 0.0.13, released on 2026-01-12. Maintained primarily by SiFive; releases are infrequent with minor fixes and improvements.","language":"python","status":"active","last_verified":"Fri May 01","install":{"commands":["pip install pydevicetree"],"cli":null},"imports":["from pydevicetree import Devicetree","from pydevicetree import Node","from pydevicetree import PropertyValue","from pydevicetree import RegArray","from pydevicetree import RangeArray"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from pydevicetree import Devicetree, Node\n\n# Parse a DTS file from string\ndts_text = \"\"\"/dts-v1/;\n/ {\n    compatible = \"example,board\";\n    memory@80000000 {\n        device_type = \"memory\";\n        reg = <0x0 0x80000000 0x0 0x40000000>;\n    };\n};\n\"\"\"\ntree = Devicetree.from_dts(dts_text)\nprint(tree.root.compatible)        # 'example,board'\nmem_node = tree.root.children['memory@80000000']\nprint(mem_node.reg)                # RegArray(...)\n\n# Create and add a new node\nnew_node = Node('serial@10000000', parent=tree.root)\nnew_node.add_property('compatible', 'ns16550')\ntree.root.add_child(new_node)\nprint(tree.to_dts())\n","lang":"python","description":"Parse a DTS string, access properties, and manipulate nodes.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}