{
"info": {
"author": "Martin Olejar",
"author_email": "martin.olejar@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Environment :: Console",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering",
"Topic :: Software Development :: Embedded Systems",
"Topic :: Utilities"
],
"description": "Flattened Device Tree Python Module\n===================================\n\n|Build Status| |Coverage Status| |PyPI Status| |Python Version|\n\nThis python module is usable for manipulation with `Device Tree\nData `__ and primary was created for `i.MX\nSmart-Boot\nTool `__\n\n Some parts in this module have been inspired from:\n https://github.com/superna9999/pyfdt project.\n\nDependencies\n------------\n\n- `Python `__ - Python 3.x interpreter\n- `Click `__ - Python package for creating\n beautiful command line interface.\n\nInstallation\n------------\n\n.. code:: bash\n\n $ pip install fdt\n\nTo install the latest version from master branch execute in shell\nfollowing command:\n\n.. code:: bash\n\n $ pip install -U https://github.com/molejar/pyFDT/archive/master.zip\n\nIn case of development, install it from cloned sources:\n\n.. code:: bash\n\n $ git clone https://github.com/molejar/pyFDT.git\n $ cd pyFDT\n $ pip install -U -e .\n\n**NOTE:** You may run into a permissions issues running these commands.\nHere are a few options how to fix it:\n\n1. Run with ``sudo`` to install ``fdt`` and dependencies globally\n2. Specify the ``--user`` option to install locally into your home\n directory (export \u201c~/.local/bin\u201d into PATH variable if haven\u2019t).\n3. Run the command in a\n `virtualenv `__ local to a\n specific project working set.\n\nUsage\n-----\n\nThe API of **fdt** module is intuitive and implementing all general\nrequirements for manipulation with FDT Nodes, Properties and dts/dtb\nfiles.\n\n.. code:: python\n\n import fdt\n\n #-----------------------------------------------\n # convert *.dtb to *.dts\n # ----------------------------------------------\n with open(\"example.dtb\", \"rb\") as f:\n dtb_data = f.read()\n\n dt1 = fdt.parse_dtb(dtb_data)\n\n with open(\"example.dts\", \"w\") as f:\n f.write(dt1.to_dts())\n\n #-----------------------------------------------\n # convert *.dts to *.dtb\n # ----------------------------------------------\n with open(\"example.dts\", \"r\") as f:\n dts_text = f.read()\n\n dt2 = fdt.parse_dts(dts_text)\n\n with open(\"example.dtb\", \"wb\") as f:\n f.write(dt2.to_dtb(version=17))\n\n #-----------------------------------------------\n # Add Property and Node into dt2\n # ----------------------------------------------\n node = fdt.Node('test_node')\n node.append(fdt.Property('basic_property'))\n node.append(fdt.PropStrings('string_property', 'value1', 'value2'))\n node.append(fdt.PropWords('words_property', 0x1000, 0x80000000, wsize=32))\n node.append(fdt.PropBytes('bytes_property', data=[0, 200, 12]))\n dt2.add_item(node)\n\n #-----------------------------------------------\n # merge dt2 into dt1\n # ----------------------------------------------\n dt1.merge(dt2)\n\n with open(\"merged.dtb\", \"wb\") as f:\n f.write(dt1.to_dtb(version=17))\n\n #-----------------------------------------------\n # diff two fdt objects\n # ----------------------------------------------\n out = fdt.diff(dt1, dt2)\n\n print(out[0]) # same in dt1 and dt2\n print(out[1]) # specific for dt1\n print(out[2]) # specific for dt2\n\n[ pydtc ] Tool\n--------------\n\nThe python device tree converter **pydtc** is a tool for conversion\n*.dts to*.dtb and vice versa. Is distributed together with **fdt**\nmodule. This tool can be in some cases used as replacement of `device\ntree compiler `__.\n\n.. code:: bash\n\n $ pydtc -?\n\n Usage: pydtc [OPTIONS] COMMAND [ARGS]...\n\n Device Tree Converter (DTC) is a tool for converting device tree binary\n blob (*.dtb) to readable text file (*.dts) and reverse\n\n Options:\n -v, --version Show the version and exit.\n -?, --help Show this message and exit.\n\n Commands:\n diff Compare two *.dtb or *.dts files\n merge Merge two and more *.dtb or *.dts files\n todtb Convert *.dts to *.dtb\n todts Convert *.dtb to *.dts\n\n$ pydtc todts [OPTIONS] INFILE\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nConvert Device Tree in binary blob *.dtb to readable text file*.dts\n\n**INFILE** - Single DTB file as \\*.dtb\n\noptions:\n''''''''\n\n- **-t, \u2013tabsize** - Tabulator Size\n- **-o, \u2013outfile** - Output path/file name (*.dts)\n- **-?, \u2013help** - Show help message and exit\n\nExample:\n''''''''\n\n.. code:: bash\n\n $ pydtc todts test.dtb\n\n DTS saved as: test.dts\n\n$ pydtc todtb [OPTIONS] INFILE\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nConvert Device Tree in readable text file *.dts to binary blob*.dtb\n\n**INFILE** - Single DTS file as \\*.dts\n\n.. _options-1:\n\noptions:\n''''''''\n\n- **-v, \u2013version** - DTB Version\n- **-l, \u2013lcversion** - DTB Last Compatible Version\n- **-c, \u2013cpuid** - Boot CPU ID\n- **-a, \u2013align** - Make the blob align to the\n- **-p, \u2013padding** - Add padding to the blob of long\n- **-s, \u2013size** - Make the blob at least long\n- **-o, \u2013outfile** - Output path/file name (*.dtb)\n- **-?, \u2013help** - Show help message and exit\n\n.. _example-1:\n\nExample:\n''''''''\n\n.. code:: bash\n\n $ pydtc todtb -v 17 test.dts\n\n DTB saved as: test.dtb\n\n$ pydtc merge [OPTIONS] OUTFILE [INFILES]\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nMerge two and more *.dtb or*.dts files into one \\*.dts file\n\n**OUTFILE** - The output file name with *.dts extension **INFILES** -\nTwo or more input files with*.dtb or \\*.dts extension\n\n.. _options-2:\n\noptions:\n''''''''\n\n- **-t, \u2013tabsize** - Tabulator Size\n- **-t, \u2013intype** - Input file type: \u2018auto\u2019, \u2018dts\u2019, \u2018dtb\u2019 (default:\n auto)\n- **-?, \u2013help** - Show help message and exit\n\n.. _example-2:\n\nExample:\n''''''''\n\n.. code:: bash\n\n $ pydtc merge out.dts test1.dtb test2.dtb\n\n Merge output saved as: out.dts\n\n$ pydtc diff [OPTIONS] FILE1 FILE2\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nCompare two dtb/dts files and generate 3 dts files (same in 1 and 2,\nspecific for 1, specific for 2)\n\n**FILE1** - Input file 1 **FILE2** - Input file 2\n\n.. _options-3:\n\noptions:\n''''''''\n\n- **-t, \u2013intype** - Input file type: \u2018auto\u2019, \u2018dts\u2019, \u2018dtb\u2019 (default:\n auto)\n- **-o, \u2013outdir** - Output directory/path (default: diff_out)\n- **-?, \u2013help** - Show help message and exit\n\n.. _example-3:\n\nExample:\n''''''''\n\n.. code:: bash\n\n $ pydtc diff test1.dtb test2.dtb\n\n Diff output saved into: diff_out\n\n.. |Build Status| image:: https://travis-ci.org/molejar/pyFDT.svg?branch=master\n :target: https://travis-ci.org/molejar/pyFDT\n.. |Coverage Status| image:: https://coveralls.io/repos/github/molejar/pyFDT/badge.svg\n :target: https://coveralls.io/github/molejar/pyFDT\n.. |PyPI Status| image:: https://img.shields.io/pypi/v/fdt.svg\n :target: https://pypi.python.org/pypi/fdt\n.. |Python Version| image:: https://img.shields.io/pypi/pyversions/fdt.svg\n :target: https://www.python.org\n\n\n",
"description_content_type": "",
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/molejar/pyFDT",
"keywords": "",
"license": "Apache 2.0",
"maintainer": "",
"maintainer_email": "",
"name": "fdt",
"package_url": "https://pypi.org/project/fdt/",
"platform": "",
"project_url": "https://pypi.org/project/fdt/",
"project_urls": {
"Homepage": "https://github.com/molejar/pyFDT"
},
"release_url": "https://pypi.org/project/fdt/0.1.2/",
"requires_dist": [
"click (>=5.0)"
],
"requires_python": ">=3.6",
"summary": "Flattened Device Tree Python Module",
"version": "0.1.2"
},
"last_serial": 3845223,
"releases": {
"0.1.0": [
{
"comment_text": "",
"digests": {
"md5": "b41f0a7f20d9677985057af850b0b812",
"sha256": "7d153b4a0992ac1184aa2b86959e49d737b8464b1a153bdf590a0d151e0a7ee2"
},
"downloads": -1,
"filename": "fdt-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b41f0a7f20d9677985057af850b0b812",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3",
"size": 15959,
"upload_time": "2018-04-14T23:36:57",
"url": "https://files.pythonhosted.org/packages/4b/e4/a5f7fa7612d09a0f04e1a5b6c898e18544e74f92446c5b27ce206b4c6dff/fdt-0.1.0-py3-none-any.whl"
}
],
"0.1.1": [
{
"comment_text": "",
"digests": {
"md5": "708f68aff66cad674ab976c33742602c",
"sha256": "56ecd2b0b173ca7684b93f4131eb5f3aa9f09bd165927cadeb14971910d917b0"
},
"downloads": -1,
"filename": "fdt-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "708f68aff66cad674ab976c33742602c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3",
"size": 20304,
"upload_time": "2018-04-15T18:54:42",
"url": "https://files.pythonhosted.org/packages/af/e6/ab3b2acddecc81e24862295a016bbc33c4478a5fd448fdf136aba8932f92/fdt-0.1.1-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "1a05445ab4af87e2259f32b8de0a4b61",
"sha256": "9b67d902a901cd534478648e2ddfcbcd24298bd1a96e21ff284af8fa6cce3aea"
},
"downloads": -1,
"filename": "fdt-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "1a05445ab4af87e2259f32b8de0a4b61",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3",
"size": 15114,
"upload_time": "2018-04-15T22:34:59",
"url": "https://files.pythonhosted.org/packages/7f/f0/6f27319088eed4ccfb8823b6c2b6860b528c3ee00983fc1af2827a2c83bf/fdt-0.1.1.tar.gz"
}
],
"0.1.2": [
{
"comment_text": "",
"digests": {
"md5": "8a7f43038045283f13c3f0f307e4bf62",
"sha256": "a5b39e9bb427ac3a3a77e3a5be8b4648d7088ddcaddb9aebf37f7d023565fbd8"
},
"downloads": -1,
"filename": "fdt-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8a7f43038045283f13c3f0f307e4bf62",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 20978,
"upload_time": "2018-05-08T19:23:19",
"url": "https://files.pythonhosted.org/packages/14/60/62fbe27ce6540bbd69b20172b0e10b1409367d3fd7ed5cceeac72f7ed0d3/fdt-0.1.2-py3-none-any.whl"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "8a7f43038045283f13c3f0f307e4bf62",
"sha256": "a5b39e9bb427ac3a3a77e3a5be8b4648d7088ddcaddb9aebf37f7d023565fbd8"
},
"downloads": -1,
"filename": "fdt-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8a7f43038045283f13c3f0f307e4bf62",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 20978,
"upload_time": "2018-05-08T19:23:19",
"url": "https://files.pythonhosted.org/packages/14/60/62fbe27ce6540bbd69b20172b0e10b1409367d3fd7ed5cceeac72f7ed0d3/fdt-0.1.2-py3-none-any.whl"
}
]
}