{ "info": { "author": "Sergey Shilin", "author_email": "shilinshtein@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Byter\nPython reader/writer for binary objects\n\n## Usage Example\n\n```python\nwith open(fpath, \"rb\") as data:\n has_data = read_bool(data)\n year = read_short(data)\n month = read_short(data)\n width = read_float(data)\n height = read_float(data)\n text = read_string(data, 70)\n array = read_array(data, size, 'unsigned_short')\n\nprint(\"has_data:\", has_data)\nprint(\"year:\", year)\nprint(\"month:\", month)\nprint(\"width:\", width)\nprint(\"height:\", height)\nprint(\"text\": text)\nprint(\"array:\")\n\n>> has_data: True\n year: 2019\n month: 9\n width: 1280.0\n height: 1024.0\n text: \"Hello World!\"\n array: [13, 4, 16]\n```\n\n## Types allowed to read/write\n\n| C Type | Python type | Size in bytes |\n| --- | --- | --- |\n| char | string of length 1 | 1 |\n| signed char | integer | 1 |\n| unsigned char | integer | 1 |\n| bool | boolean | 1 |\n| short | integer | 2 |\n| unsigned short | integer | 2 |\n| int | integer | 4 |\n| unsigned int | integer | 4 |\n| long | integer | 4 |\n| unsigned long | integer | 4 |\n| long long | integer | 8 |\n| unsigned long long | integer | 8 |\n| float | float | 4 |\n| double | float | 8 |\n| char[] | string | |\n\n## Methodes allowed\n\nFor each C type from the table in the previous section, there is a `read_` and a `write_` function that performs a reading/writing of a specified number of bytes from the binary object. For example,\n\n```python\na = read_unsigned_long(data)\n```\n\nwill read 4 consequent bytes from the binary source `data`.\n\nHowever, to read an array of chars (string) the method is\n\n```python\ns = read_string(data, s_len)\n```\n\nIt is also possible to read an array of bytes using the following method:\n\n```python\narr = read_array(data, size, 'unsigned_short')\n```\n\nThis will read a sequence of length `size` of unsigned ints, `size * 4` bytes in total.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/sergeyshilin/byter", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "byter", "package_url": "https://pypi.org/project/byter/", "platform": "", "project_url": "https://pypi.org/project/byter/", "project_urls": { "Homepage": "https://github.com/sergeyshilin/byter" }, "release_url": "https://pypi.org/project/byter/0.0.1/", "requires_dist": null, "requires_python": ">=3.6", "summary": "Python binary object reader/writer", "version": "0.0.1" }, "last_serial": 5945200, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "3141c5a429f7e469f0343fb6bfdca67f", "sha256": "e2cf23f793f0252dbd6fa77efe7b776e477d86e5f9165e59f42c24e889c42fa6" }, "downloads": -1, "filename": "byter-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "3141c5a429f7e469f0343fb6bfdca67f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 16277, "upload_time": "2019-10-08T14:50:08", "url": "https://files.pythonhosted.org/packages/d3/80/13d353b4db1b51e4ba14d846dd04b6c780b673b251db0ca84cdb2d453387/byter-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "55958369c150d5c7d66c709975af224b", "sha256": "9de8fc8e6eb163049bc1988e7f26df882ec94420c5010d1147c4a12f2508be01" }, "downloads": -1, "filename": "byter-0.0.1.tar.gz", "has_sig": false, "md5_digest": "55958369c150d5c7d66c709975af224b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3199, "upload_time": "2019-10-08T14:50:13", "url": "https://files.pythonhosted.org/packages/b1/a0/91e2bf17ae5642c10f5d6a73a549596bb6e6e04f0c546aad8136fa9a7c46/byter-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3141c5a429f7e469f0343fb6bfdca67f", "sha256": "e2cf23f793f0252dbd6fa77efe7b776e477d86e5f9165e59f42c24e889c42fa6" }, "downloads": -1, "filename": "byter-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "3141c5a429f7e469f0343fb6bfdca67f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 16277, "upload_time": "2019-10-08T14:50:08", "url": "https://files.pythonhosted.org/packages/d3/80/13d353b4db1b51e4ba14d846dd04b6c780b673b251db0ca84cdb2d453387/byter-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "55958369c150d5c7d66c709975af224b", "sha256": "9de8fc8e6eb163049bc1988e7f26df882ec94420c5010d1147c4a12f2508be01" }, "downloads": -1, "filename": "byter-0.0.1.tar.gz", "has_sig": false, "md5_digest": "55958369c150d5c7d66c709975af224b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3199, "upload_time": "2019-10-08T14:50:13", "url": "https://files.pythonhosted.org/packages/b1/a0/91e2bf17ae5642c10f5d6a73a549596bb6e6e04f0c546aad8136fa9a7c46/byter-0.0.1.tar.gz" } ] }