{ "info": { "author": "Barry Scott", "author_email": "barry@barrys-emacs.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Module namedstruct\n------------------\n\nnamedstruct encapsulates struct.unpack() and struct.pack() with results accessed by name.\n\nClasses\n-------\n\n class namedstruct.namedstruct\n\n __init__( description, struct_definition )\n\n The *description* is used to title a dump of unpacked data.\n\n *struct_definition* is a single string that defines the type and name of each field\n as a space seperated list.\n Each field's type and name are seperated by a \":\". If the name is left blank that\n field cannot be accessed by name, useful\n for padding fields. If a field's type has a repeat count the value returned with\n be a tuple of all the fields parts.\n\n len()\n\n Returns the size of the struct.\n\n unpack( bytes )\n\n Unpack the *bytes* into a namestruct.namestructresults object used to access the decoded fields.\n\n packer( from_unpacked=None )\n\n Return a namedstructpacker object that can be used to pack the fields into a buffer.\n The optional from_unpacked will initialise the fields from a previously unpacked\n buffer.\n\n class namedstruct.namedstructresults\n\n .*name*\n\n Returns the value of the field called name.\n\n dump( writer )\n\n Using the writer function to output a formatted dump of the whole struct.\n\n class namedstruct.namedstructpacker\n\n .*name* = value\n\n Assign a value to the named field\n\n init_from( from_unpacked )\n\n Assign each field from a previous unpacked buffer's namedstructresults.\n\n pack()\n\n Pack the fields and return the bytes buffer.\n\nExample\n-------\n\n::\n\n import namedstruct\n\n # Windows EXE files start with a DOS header\n struct_windows_exe_header = namedstruct.namedstruct( 'DOS header', '<'\n '2s:dos_magic '\n 'h:lastsize '\n 'h:nblocks '\n 'h:nreloc '\n 'h:hdrsize '\n 'h:minalloc '\n 'h:maxalloc '\n 'H:ss '\n 'H:sp '\n 'h:checksum '\n 'H:ip '\n 'H:cs '\n 'h:relocpos '\n 'h:noverlay '\n '4H:reserved1 '\n 'h:oem_id '\n 'h:oem_info '\n '10H:reserved2 '\n 'L:pe_offset'\n )\n\n dos_image = open( 'c:\\\\windows\\\\system32\\\\cmd.exe', 'rb' ).read()\n header = struct_windows_exe_header.unpack( dos_image[0:len(struct_windows_exe_header)] )\n\n if debug:\n header.dump( print )\n\n print( 'dos_magic %r' % (header.dos_magic,) )\n print( 'PE header offer: 0x%8.8x' % (header.pe_offset,) )\n\n\n\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/barry-scott/namedstruct", "keywords": "development", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "namedstruct", "package_url": "https://pypi.org/project/namedstruct/", "platform": "", "project_url": "https://pypi.org/project/namedstruct/", "project_urls": { "Homepage": "https://github.com/barry-scott/namedstruct" }, "release_url": "https://pypi.org/project/namedstruct/1.2.2/", "requires_dist": null, "requires_python": "", "summary": "namedstruct encapsulates struct.unpack() with results accessed by name", "version": "1.2.2" }, "last_serial": 5571389, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "060857aec03d0909df81160c710cd2d0", "sha256": "8aacb2741c450da51c4961475b3523e56871e53987df8a2c851c2df7330e6603" }, "downloads": -1, "filename": "namedstruct-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "060857aec03d0909df81160c710cd2d0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3307, "upload_time": "2016-01-10T14:45:44", "url": "https://files.pythonhosted.org/packages/2c/f7/a07a98df5ff1b4acae778414fa4b5d3b276985ecb860a8687029a5e5f4f7/namedstruct-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d8ac4822827551f04c7f7556aabcf537", "sha256": "97c6a3cc9c7783405e0baed783dc9e2dc43f97e0db18531da7d5356679628d17" }, "downloads": -1, "filename": "namedstruct-1.0.0.zip", "has_sig": false, "md5_digest": "d8ac4822827551f04c7f7556aabcf537", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11108, "upload_time": "2016-01-10T14:45:49", "url": "https://files.pythonhosted.org/packages/47/09/3803876e548cc37fb744927b254d887c208ddc5f68bb4886b63f9747fef4/namedstruct-1.0.0.zip" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "4f30ba38a6001fced396a6442947e7a4", "sha256": "48e774b2cd1f18a62c14154794c4d7c01f0d479c9dbf430ff2e907baa35ed0e3" }, "downloads": -1, "filename": "namedstruct-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "4f30ba38a6001fced396a6442947e7a4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3734, "upload_time": "2016-01-20T09:27:57", "url": "https://files.pythonhosted.org/packages/b0/8a/371e5412e20e5b3c9542680abcbaf910d2d81deb58c5e0d30dea85a114ea/namedstruct-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ed921586fd0901aa8acefea1ca231a36", "sha256": "ee25dcf21955d5f6c9da22a2f7d53fe682da5fcfa2a9193ae656eca15d866bbf" }, "downloads": -1, "filename": "namedstruct-1.1.0.zip", "has_sig": false, "md5_digest": "ed921586fd0901aa8acefea1ca231a36", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11538, "upload_time": "2016-01-20T09:28:22", "url": "https://files.pythonhosted.org/packages/1f/13/c94d3348fd97642bfe3fc1750049c627304db16aef0574d2451b8d1b2f1b/namedstruct-1.1.0.zip" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "bffa1261164e2b15f5dfbcd8954cc861", "sha256": "5aeaf2ab4e9a61a35542b305a861da64dc0ef9efa7c39d6f8adc4dae74e85fa2" }, "downloads": -1, "filename": "namedstruct-1.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "bffa1261164e2b15f5dfbcd8954cc861", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7380, "upload_time": "2019-07-14T18:42:47", "url": "https://files.pythonhosted.org/packages/50/59/4dbfee32032a5f533271f34d8d04982167afe16e67cdcc92212e86c1bce1/namedstruct-1.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "641093ef34c5f748b1021284d13e3341", "sha256": "84d4253a09ae8611de95af6da29a4e93de9eb4d277e38f040ebe973ace6dffd7" }, "downloads": -1, "filename": "namedstruct-1.2.1.tar.gz", "has_sig": false, "md5_digest": "641093ef34c5f748b1021284d13e3341", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8748, "upload_time": "2019-07-14T18:42:52", "url": "https://files.pythonhosted.org/packages/6f/bb/badf32dbc089014780e0e9a6ab66827fa3d5e25bd04d751c8187f824963f/namedstruct-1.2.1.tar.gz" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "7e2010bb6b155eb789068bb443858fe3", "sha256": "67727624e4a290ecb5202660bd67423d1538d20fc64b70f80935f81ef522701f" }, "downloads": -1, "filename": "namedstruct-1.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "7e2010bb6b155eb789068bb443858fe3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8405, "upload_time": "2019-07-23T09:16:53", "url": "https://files.pythonhosted.org/packages/3a/ab/8ca10f811c49c07b4bd539620a88964b272730e9a48a0d71c972e60da45b/namedstruct-1.2.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4ad628e013e2155fe85743325e30ea3b", "sha256": "4b5c29bf1f775b45c18f87b7dc022fd69d93af914d60de17006bbada12bcf617" }, "downloads": -1, "filename": "namedstruct-1.2.2.tar.gz", "has_sig": false, "md5_digest": "4ad628e013e2155fe85743325e30ea3b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8631, "upload_time": "2019-07-23T09:16:56", "url": "https://files.pythonhosted.org/packages/6c/56/0e84f1050c72bf4d8e8f1abefaf012b391a974b655723672799f312b538d/namedstruct-1.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7e2010bb6b155eb789068bb443858fe3", "sha256": "67727624e4a290ecb5202660bd67423d1538d20fc64b70f80935f81ef522701f" }, "downloads": -1, "filename": "namedstruct-1.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "7e2010bb6b155eb789068bb443858fe3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8405, "upload_time": "2019-07-23T09:16:53", "url": "https://files.pythonhosted.org/packages/3a/ab/8ca10f811c49c07b4bd539620a88964b272730e9a48a0d71c972e60da45b/namedstruct-1.2.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4ad628e013e2155fe85743325e30ea3b", "sha256": "4b5c29bf1f775b45c18f87b7dc022fd69d93af914d60de17006bbada12bcf617" }, "downloads": -1, "filename": "namedstruct-1.2.2.tar.gz", "has_sig": false, "md5_digest": "4ad628e013e2155fe85743325e30ea3b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8631, "upload_time": "2019-07-23T09:16:56", "url": "https://files.pythonhosted.org/packages/6c/56/0e84f1050c72bf4d8e8f1abefaf012b391a974b655723672799f312b538d/namedstruct-1.2.2.tar.gz" } ] }