{ "info": { "author": "Guillaume Schworer", "author_email": "guillaume.schworer@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": ".. joystick\n\n.. image:: https://travis-ci.org/ceyzeriat/byt.svg?branch=master\n :target: https://travis-ci.org/ceyzeriat/byt\n.. image:: https://coveralls.io/repos/github/ceyzeriat/byt/badge.svg\n :target: https://coveralls.io/github/ceyzeriat/byt\n.. image:: http://img.shields.io/badge/license-GPLv3-blue.svg?style=flat\n :target: https://github.com/ceyzeriat/byt/blob/master/LICENSE\n\n:Name: byt\n:Website: https://github.com/ceyzeriat/byt\n:Author: Guillaume Schworer\n:Version: 1.1\n\n\nAlthough the new python3 strings/bytes-chains are arguably neater than that of python2, writing code using them, and which is compatible with both versions, is nearly a nightmare. This package attempts to gap the major discontinuity in the management of strings and bytes-chains between the two major python versions, 2.7+ and 3.5+.\n\nByt is a package subclassing ``str`` in python2 and ``bytes`` in python3. Its main design focus is to behaves exactly the same way, no matter the python version used. To achieve such behaviour, byt is extremely conservative: Byt objects will only work with other Byt objects (concatenate, find, replace, etc). This was (unfortunately?) necessary to ensure the somewhat lax python2 strings and bytes-chains mix-up work the same way as those of python3.\n\nThis packages also fixes some strange behaviors of python3 ``bytes`` (try ``b'test'[0:1] == b'test'[0]``) and provides new convenient methods or properties.\n\n\nIt is built by `Guillaume Schworer `_ and licensed under\nthe GNU General Public License v3 or later (GPLv3+) license (see ``LICENSE``).\n\n\nInstallation\n------------\n\nJust run\n\n::\n\n pip install byt\n\nto get the most recent stable version.\n\n\nUsage\n-----\n\nThe two entry points are the ``byt.Byt`` and ``byt.DByt`` classes which automatically\nload depending on the python version you're running.\n\nThe only difference between ``Byt`` and ``DByt`` is that ``str(Byt)`` will print the ASCII\nrepresentation of the string while ``str(DByt)`` -- D like display -- will print its\ncorresponding hexadecimal values. These classes are full inter-operable.\n\nYou'll just use it like this:\n\n::\n\n from byt import Byt\n\n >> b = Byt('hello world!')\n >> print(b)\n Byt('hello world!')\n >> (Byt(1,2) + Byt(\"\\x01\\x02\") + Byt([1,2])).hex()\n '01 02 01 02 01 02'\n >> print(b.hex())\n 68 65 6c 6c 6f 20 77 6f 72 6c 64 21\n >> eval(repr(b)) == b\n True\n >> print(Byt('str1') + 'str2')\n TypeError: can't concat Byt to str\n >> byt.Byt('str1')[2:].ints()\n [114, 49]\n \n \n from byt import DByt\n \n >> b = DByt('hello world!')\n >> print(b)\n 68 65 6c 6c 6f 20 77 6f 72 6c 64 21\n >> eval(repr(b)) == b\n True\n \n # inter-compatibility\n \n >> DByt('yes') == Byt('yes')\n True\n >> DByt('yes') + Byt('no')\n DByt('yesno')\n >> print(DByt('yes') + Byt('no'))\n 79 65 73 6e 6f\n\n\nDocumentation\n-------------\n\nAll the options are documented in the docstrings for the classes. These can be viewed in a Python shell using:\n\n::\n\n >> from byt import Byt, DByt\n >> print(Byt.__doc__)\n >> print(DByt.__doc__)\n\nor, in IPython using:\n\n::\n\n >> from byt import Byt\n >> Byt?\n >> DByt?\n\n\nLicense\n-------\n\nCopyright 2017 Guillaume Schworer\n\npatiencebar is free software made available under the GNU General\nPublic License v3 or later (GPLv3+) license (see ``LICENSE``).\n\n\nChangelog\n---------\n\n1.1.0 (2017-11-12)\n+++++++++++++++++++\n\n- Added docs and tests\n- New initialization of Byt/DByt object: Byt(1,2,3)\n\n\n1.0.12 (2017-08-12)\n+++++++++++++++++++\n\n- Added DByt hexadecimal as the default __str__, while __repr__ remains ASCII-based\n- New method 'str'\n\n\n1.0.8 (2017-06-26)\n++++++++++++++++++\n\n- Fixed repr method and backslashing\n\n\n1.0.6 (2017-03-22)\n++++++++++++++++++\n\n- Fixed install bug through pip\n\n\n1.0.4 (2017-03-22)\n++++++++++++++++++\n\n- Added fromhex classmethod\n\n\n1.0.3 (2017-02-22)\n++++++++++++++++++\n\n- Fixed bug when invoking isinstance on a Byt object\n\n\n1.0.0 (2017-02-19)\n++++++++++++++++++\n\n- Initial release.", "description_content_type": null, "docs_url": "https://pythonhosted.org/byt/", "download_url": "https://github.com/ceyzeriat/byt/tree/master/dist", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ceyzeriat/byt/", "keywords": "bytes,chain,octet,string,hexa,hexadecimal,python2,python3,version,independent", "license": "GNU", "maintainer": "", "maintainer_email": "", "name": "byt", "package_url": "https://pypi.org/project/byt/", "platform": "", "project_url": "https://pypi.org/project/byt/", "project_urls": { "Download": "https://github.com/ceyzeriat/byt/tree/master/dist", "Homepage": "https://github.com/ceyzeriat/byt/" }, "release_url": "https://pypi.org/project/byt/1.1.0/", "requires_dist": null, "requires_python": "", "summary": "Version-independent bytes-chains", "version": "1.1.0" }, "last_serial": 3326107, "releases": { "1.0.12": [ { "comment_text": "", "digests": { "md5": "f8c6cf0ca9abb47ab0ef40bbb3079e78", "sha256": "a79e3a2cf3af012fa4b3c15646400060c3c5a82dec06e573d877d3c19a2dfce8" }, "downloads": -1, "filename": "byt-1.0.12.tar.gz", "has_sig": false, "md5_digest": "f8c6cf0ca9abb47ab0ef40bbb3079e78", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5808, "upload_time": "2017-08-12T11:53:56", "url": "https://files.pythonhosted.org/packages/db/01/67ab795abff031e7450bb556d04ea3251fd75d3046c0885b8dbc53c08527/byt-1.0.12.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "1842159cb972ce7fb6a2961e243e6ff4", "sha256": "8cea556cb1379ae038c20cc98ff47a353e310680209b6f7bec96f99c0ae68ce0" }, "downloads": -1, "filename": "byt-1.1.0.tar.gz", "has_sig": false, "md5_digest": "1842159cb972ce7fb6a2961e243e6ff4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7017, "upload_time": "2017-11-12T11:55:44", "url": "https://files.pythonhosted.org/packages/5d/94/6c2738b1add2eb6344a78522774ce565ae07ef4df7ee0b2934abcc92a814/byt-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1842159cb972ce7fb6a2961e243e6ff4", "sha256": "8cea556cb1379ae038c20cc98ff47a353e310680209b6f7bec96f99c0ae68ce0" }, "downloads": -1, "filename": "byt-1.1.0.tar.gz", "has_sig": false, "md5_digest": "1842159cb972ce7fb6a2961e243e6ff4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7017, "upload_time": "2017-11-12T11:55:44", "url": "https://files.pythonhosted.org/packages/5d/94/6c2738b1add2eb6344a78522774ce565ae07ef4df7ee0b2934abcc92a814/byt-1.1.0.tar.gz" } ] }