{ "info": { "author": "iGio90", "author_email": "giovanni.rocca.90@gmail.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "# PyByteBuffer\n\nA library to manipulate buffers inspired by [Java nio ByteBuffer](https://docs.oracle.com/javase/7/docs/api/java/nio/ByteBuffer.html)\n\n> [>> DOCUMENTATION](https://igio90.github.io/PyByteBuffer/)\n\n## Setup\n\n```\npip3 install PyByteBuffer\n```\n\n## Usage\n\n```python\nfrom PyByteBuffer import ByteBuffer\n\nbuf = ByteBuffer.allocate(50)\n# write byte 0x10 and increment position by 1\nbuf.put(0x10)\nbuf.put([0xcc, 0xdd, 0xee])\nbuf.put('something')\nbuf.put(bytes([00] * 4))\n\n# endianness\nbuf.put(123456, 'little')\nbuf.put(1234561434234234, 'big')\n\n# read 1 byte and increment position by 1\nvalue = buf.get(1)\n# read 10 bytes little endian and increment position by 10\nvalue = buf.get(10, 'little')\n\n# other allocations\nbuf = ByteBuffer.from_hex('deadbeef')\nbuf = ByteBuffer.wrap(bytes())\n```\n\n## About performances\nThe performance analysis we can do in this library is all around the conversion between int->bytes bytes<-int.\n\nTested with a cycle of 1/100/500/1000 conversion using python3 builtin api int.to_bytes/from_bytes, struct pack/unpack and a \"primitive\" solution\nposted in [stackoverflow](https://stackoverflow.com/a/35634239)\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/iGio90/PyByteBuffer", "keywords": "", "license": "GPL 3.0", "maintainer": "", "maintainer_email": "", "name": "PyByteBuffer", "package_url": "https://pypi.org/project/PyByteBuffer/", "platform": "", "project_url": "https://pypi.org/project/PyByteBuffer/", "project_urls": { "Homepage": "https://github.com/iGio90/PyByteBuffer" }, "release_url": "https://pypi.org/project/PyByteBuffer/1.0.4/", "requires_dist": null, "requires_python": ">=3", "summary": "A bytes manipulation library inspired by Java ByteBuffer", "version": "1.0.4" }, "last_serial": 4867316, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "fc5dde6001124fa1fb7776ddc772dbde", "sha256": "0f11c6def20652bb0e177edbfb08db160e0314d2538c517fa04499ef96c1d1b8" }, "downloads": -1, "filename": "PyByteBuffer-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "fc5dde6001124fa1fb7776ddc772dbde", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 5542, "upload_time": "2019-02-16T13:47:08", "url": "https://files.pythonhosted.org/packages/94/06/acf2c567d61dffd18a414c1588f9160e127f08b7a5477e3e2d65b922fa5a/PyByteBuffer-1.0.1-py3-none-any.whl" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "2a55dba0865da4292d15f325c9d0c7a0", "sha256": "739f583be5bbbf5d483290a76db922d9114b5aa4a335e718af5773962ef18494" }, "downloads": -1, "filename": "PyByteBuffer-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "2a55dba0865da4292d15f325c9d0c7a0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 5998, "upload_time": "2019-02-16T14:07:22", "url": "https://files.pythonhosted.org/packages/ea/37/040c0b8d1e46ca86391610a4bade0149e5874247348c5cf6edf977e3d6ca/PyByteBuffer-1.0.2-py3-none-any.whl" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "cb2da9367231f5a1ef61e4956aa185c1", "sha256": "47757cf772ae84fc050397de01d2470a67b1f15a72b4ea559b18a62bee0b9f9f" }, "downloads": -1, "filename": "PyByteBuffer-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "cb2da9367231f5a1ef61e4956aa185c1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 4968, "upload_time": "2019-02-16T15:50:29", "url": "https://files.pythonhosted.org/packages/5b/04/9c3fae6851a40b867ebe76e0f001dbb3956f87e571a00dcf5e3215948513/PyByteBuffer-1.0.3-py3-none-any.whl" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "35edf73e4408fe34a2d35ba640fb51fe", "sha256": "0515a6cbc67f2b5f0788fe5cd80bc88c62d2b1f85640c2c74b34cdaa07791616" }, "downloads": -1, "filename": "PyByteBuffer-1.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "35edf73e4408fe34a2d35ba640fb51fe", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 5160, "upload_time": "2019-02-25T23:49:58", "url": "https://files.pythonhosted.org/packages/3e/18/bf65ceaf9b030baa38d33ab823ba29f0509acd8da41e45dd4c53be970ce2/PyByteBuffer-1.0.4-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "35edf73e4408fe34a2d35ba640fb51fe", "sha256": "0515a6cbc67f2b5f0788fe5cd80bc88c62d2b1f85640c2c74b34cdaa07791616" }, "downloads": -1, "filename": "PyByteBuffer-1.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "35edf73e4408fe34a2d35ba640fb51fe", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 5160, "upload_time": "2019-02-25T23:49:58", "url": "https://files.pythonhosted.org/packages/3e/18/bf65ceaf9b030baa38d33ab823ba29f0509acd8da41e45dd4c53be970ce2/PyByteBuffer-1.0.4-py3-none-any.whl" } ] }