{ "info": { "author": "Jochen Gerhaeusser", "author_email": "jochen_privat@gmx.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only", "Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator", "Topic :: Scientific/Engineering :: Visualization", "Topic :: Software Development", "Topic :: Software Development :: Embedded Systems", "Topic :: Software Development :: Testing" ], "description": "\n.. |Doc Status| image:: https://readthedocs.org/projects/konfoo/badge/?version=latest\n :target: http://konfoo.readthedocs.io/en/latest/?badge=latest\n.. |Build Status| image:: https://travis-ci.org/JoeVirtual/KonFoo.svg?branch=master\n :target: https://travis-ci.org/JoeVirtual/KonFoo\n.. |PyPI| image:: https://img.shields.io/pypi/v/KonFoo.svg\n :target: https://pypi.org/project/KonFoo\n.. |License| image:: https://img.shields.io/pypi/l/KonFoo.svg\n :target: https://pypi.org/project/KonFoo\n.. |Python| image:: https://img.shields.io/pypi/pyversions/KonFoo.svg\n :target: https://pypi.org/project/KonFoo\n.. |Status| image:: https://img.shields.io/pypi/status/KonFoo.svg\n :target: https://pypi.org/project/KonFoo\n.. |Binder| image:: https://mybinder.org/badge.svg\n :target: https://mybinder.org/v2/gh/JoeVirtual/KonFoo/master?filepath=notebooks\n\nKonF'00'\n========\n\n|Doc Status| |Build Status| |PyPI| |License| |Python| |Status| |Binder|\n\nKonFoo is a Python Package for creating byte stream mappers in a declarative\nway with as little code as necessary to help fighting the confusion with the\nfoo of the all too well-known memory dumps or hexadecimal views of binary\ndata.\n\nIt comes with sensible defaults out of the box.\n\nIt aims to make the process of reading, de-serializing, viewing, serializing\nand writing binary data from and back to a data provider as easy as possible.\n\nKonFoo in points:\n\n- declarative way to describe the mapping of binary data to Python types\n- declarative classes to read, deserialize, serialize and write binary data\n from and back to a data source\n- easy adjustable byte stream provider bridge to any kind of data source\n- nesting of classes\n- adaptable classes on the fly while reading/de-serializing binary data\n- easy syntax for accessing nested fields\n- view the mapped binary data as a JSON string\n- list the mapped binary data as a flatten list or dictionary\n- write the mapped binary data to a ``.csv`` file\n- save the mapped binary data to an ``.ini`` file\n- load the mapped binary data from an ``.ini`` file\n- easy creatable nested metadata dictionaries of the members of a byte stream mapper\n- metadata converter to the ``flare.json`` format to visualise the mapper with\n `d3.js `_.\n\n\nExample\n-------\n\nA short example how to define a byte stream mapper.\n\n>>> from konfoo import *\n\n>>> class Identifier(Structure):\n... def __init__(self):\n... super().__init__()\n... self.version = Byte(align_to=4)\n... self.id = Unsigned(8, align_to=4)\n... self.length = Decimal(8, align_to=4)\n... self.module = Char(align_to=4)\n... self.index_fields()\n>>> class HeaderV1(Structure)\n... def __init__(self):\n... super().__init__()\n... self.type = Identifier()\n>>> class HeaderV2(HeaderV1)\n... def __init__(self):\n... super().__init__()\n... self.size = Decimal(16)\n>>> header = HeaderV2()\n>>> header.to_list()\n[('Structure.type.version', '0x0'),\n ('Structure.type.id', '0x0'),\n ('Structure.type.length', 0),\n ('Structure.type.module', '\\x00'),\n ('Structure.size', 0)]\n>>> header.type.to_csv()\n[{'id': 'Identifier.version', 'value': '0x0'},\n {'id': 'Identifier.id', 'value': '0x0'},\n {'id': 'Identifier.length', 'value': 0},\n {'id': 'Identifier.module', 'value': '\\x00'}]\n>>> header.to_json()\n'{\"type\": {\"version\": \"0x0\", \"id\": \"0x0\", \"length\": 0, \"module\": \"\\u0000\"},\n \"size\": 0}'\n>>> header.deserialize(bytes.fromhex('0102094610'))\n>>> header.to_json()\n'{\"type\": {\"version\": \"0x1\", \"id\": \"0x2\", \"length\": 9, \"module\": \"F\"},\n \"size\": 16}'\n>>> bytes(header).hex()\n'0102094610'\n\n>>> header = Structure(\n... type=Structure(version=Byte(4),\n... id=Unsigned(8, 4),\n... length=Decimal(8, 4),\n... module=Char(4)),\n... size=Decimal(16))\n>>> header.to_list()\n[('Structure.type.version', '0x0'),\n ('Structure.type.id', '0x0'),\n ('Structure.type.length', 0),\n ('Structure.type.module', '\\x00'),\n ('Structure.size', 0)]\n>>> header.type.to_csv()\n[{'id': 'Structure.version', 'value': '0x0'},\n {'id': 'Structure.id', 'value': '0x0'},\n {'id': 'Structure.length', 'value': 0},\n {'id': 'Structure.module', 'value': '\\x00'}]\n>>> header.to_json()\n'{\"type\": {\"version\": \"0x0\", \"id\": \"0x0\", \"length\": 0, \"module\": \"\\u0000\"},\n \"size\": 0}'\n>>> header.deserialize(bytes.fromhex('0102094610'))\n>>> header.to_json()\n'{\"type\": {\"version\": \"0x1\", \"id\": \"0x2\", \"length\": 9, \"module\": \"F\"},\n \"size\": 16}'\n>>> bytes(header).hex()\n'0102094610'\n\n\nInstalling\n----------\n\n.. code-block:: bash\n\n > pip install konfoo\n\nLinks\n-----\n\n* `Code `_\n* `Documentation `_\n* `Development version\n `_\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "http://github.com/JoeVirtual/KonFoo/zipball/master#egg=konfoo-dev", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/JoeVirtual/KonFoo", "keywords": "binary data deserialize serialize parse decode encode unpack pack", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "KonFoo", "package_url": "https://pypi.org/project/KonFoo/", "platform": "any", "project_url": "https://pypi.org/project/KonFoo/", "project_urls": { "Download": "http://github.com/JoeVirtual/KonFoo/zipball/master#egg=konfoo-dev", "Homepage": "http://github.com/JoeVirtual/KonFoo" }, "release_url": "https://pypi.org/project/KonFoo/1.0/", "requires_dist": null, "requires_python": ">=3.5", "summary": "A declarative byte stream mapping engine.", "version": "1.0" }, "last_serial": 4651944, "releases": { "0.1a9": [ { "comment_text": "", "digests": { "md5": "8cd20722d9218744a4309698879b05ed", "sha256": "5b8584fd2353d6a123807fc5705c5096432ab202f96783f523dd4a10a8d74c30" }, "downloads": -1, "filename": "KonFoo-0.1a9-py3-none-any.whl", "has_sig": false, "md5_digest": "8cd20722d9218744a4309698879b05ed", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 46633, "upload_time": "2017-10-25T03:25:57", "url": "https://files.pythonhosted.org/packages/2c/0d/2eb648882c4938253a866871c772c61d6378fbb9d629cb1f604e6dab34c3/KonFoo-0.1a9-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "75742f3c78b864d5fc19d07d77a46d2f", "sha256": "48d58b0f58b811739a339974ea83932bf01b6f95818e0b6497a4e0717e141e8f" }, "downloads": -1, "filename": "KonFoo-0.1a9.tar.gz", "has_sig": false, "md5_digest": "75742f3c78b864d5fc19d07d77a46d2f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 72593, "upload_time": "2017-10-25T03:25:55", "url": "https://files.pythonhosted.org/packages/68/00/7cf26f33d4523a3e42ffd8de7f07d92e74261c3ee6de7e54e57822244a37/KonFoo-0.1a9.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "c386abeb85aebec949fa47b711349fe8", "sha256": "2b94666936c82aecd1c86bd9286099faf0bcbdfbd3982e5599e8d4c97de177eb" }, "downloads": -1, "filename": "KonFoo-1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "c386abeb85aebec949fa47b711349fe8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 51133, "upload_time": "2019-01-02T07:11:38", "url": "https://files.pythonhosted.org/packages/2e/5e/046f739205bb1402a9665cff9efd63945f3e349435087653e18f02ebfc32/KonFoo-1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a1ad16d4ead9841abc3aa1db871911e0", "sha256": "2082e5c66801c0348d06b77af8415b2b80fbd97971f5dceab5a00556df499b4e" }, "downloads": -1, "filename": "KonFoo-1.0.tar.gz", "has_sig": false, "md5_digest": "a1ad16d4ead9841abc3aa1db871911e0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 91525, "upload_time": "2019-01-02T07:11:41", "url": "https://files.pythonhosted.org/packages/f7/7e/6e0189a2f3943a16714e06c5d589441cc4dcf662de3854015d374734458d/KonFoo-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c386abeb85aebec949fa47b711349fe8", "sha256": "2b94666936c82aecd1c86bd9286099faf0bcbdfbd3982e5599e8d4c97de177eb" }, "downloads": -1, "filename": "KonFoo-1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "c386abeb85aebec949fa47b711349fe8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 51133, "upload_time": "2019-01-02T07:11:38", "url": "https://files.pythonhosted.org/packages/2e/5e/046f739205bb1402a9665cff9efd63945f3e349435087653e18f02ebfc32/KonFoo-1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a1ad16d4ead9841abc3aa1db871911e0", "sha256": "2082e5c66801c0348d06b77af8415b2b80fbd97971f5dceab5a00556df499b4e" }, "downloads": -1, "filename": "KonFoo-1.0.tar.gz", "has_sig": false, "md5_digest": "a1ad16d4ead9841abc3aa1db871911e0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 91525, "upload_time": "2019-01-02T07:11:41", "url": "https://files.pythonhosted.org/packages/f7/7e/6e0189a2f3943a16714e06c5d589441cc4dcf662de3854015d374734458d/KonFoo-1.0.tar.gz" } ] }