{ "info": { "author": "Andrey Kislyuk", "author_email": "kislyuk@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "eight: Python 2 to the power of 3\n=================================\nEight is a Python module that provides a minimalist compatibility layer between Python 3 and 2. Eight lets you write\ncode for Python 3.3+ while providing limited compatibility with Python 2.7 with no code changes. Eight is inspired by\n`six `_, `nine `_, and `python-future\n`_, but provides better internationalization (i18n) support, is more\nlightweight, easier to use, and unambiguously biased toward Python 3 code: if you remove eight from your code, it will\ncontinue to function exactly as it did with eight on Python 3.\n\nTo write code for Python 3 that is portable to Python 2, you may also want to read Armin Ronacher's excellent `Python 3\nporting guide `_, as well as the official\n`porting guide `_.\n\nWriting ``from eight import *`` in your code is a no-op in Python 3. In Python 2, it binds a bunch of Python 3 names to\ntheir Python 2 equivalents. Also, if you need to import a module or module member that was renamed in Python 3, writing\n``from eight import `` will do the right thing (equivalent to ``import `` on Python 3 and ``import\n as `` on Python 2). Finally, eight can optionally wrap your standard streams and environment variable\nI/O to use text, not bytes (see below).\n\nInstallation\n------------\n::\n\n pip install eight\n\nSynopsis\n--------\n\n.. code-block:: python\n\n from eight import *\n from eight import queue\n from eight.collections import UserList, deque\n\nIf you use ``print``, division, non-ASCII literals, or relative imports, you should also add this `future import\n`_ at the top of each source file:\n\n.. code-block:: python\n\n from __future__ import (print_function, division, unicode_literals, absolute_import)\n\nWrapping stdio\n--------------\nEight provides wrappers for ``sys.stdin``, ``sys.stdout``, and ``sys.stderr`` to make them (and methods that use them)\nbehave like they do on Python 3. Specifically, in Python 3 these streams accept text data, and their ``.buffer`` attributes\nrefer to the underlying streams that accept bytes. Eight uses the `io `_ module\nto do the same for you, but subclasses the TextIOWrapper class for ``sys.stdout`` and ``sys.stderr`` to coerce non-unicode\ninput to unicode on Python 2 (otherwise, because of the Python 2 semantics, things like exception printing cease to work).\n\nTo enable stdio wrapping, use the following:\n\n.. code-block:: python\n\n import eight\n eight.wrap_stdio()\n\nTo revert the effects of this on any of the streams, use the detach method, e.g. ``sys.stdin = sys.stdin.detach()`` (but\nremember to condition this on ``eight.USING_PYTHON2``). See the `io module documentation\n`_ for more information.\n\nDecoding command-line arguments\n-------------------------------\nEight provides a utility function to decode the contents of ``sys.argv`` on Python 2 (as Python 3 does). It uses\n``sys.stdin.encoding`` as the encoding to do so:\n\n.. code-block:: python\n\n import eight\n eight.decode_command_line_args()\n\nThe call to ``decode_command_line_args()`` replaces ``sys.argv`` with its decoded contents and returns the new contents.\nOn Python 3, the call is a no-op (it returns ``sys.argv`` and leaves it intact).\n\nWrapping environment variable getters and setters\n-------------------------------------------------\nEight provides utility wrappers to help bring Python 2 environment variable access and assignment in line with Python\n3: encode the input to ``os.putenv`` (which is used for statements like ``os.environ[x] = y``) and decode the output of\n``os.getenv`` (used for ``x = os.environ[y]``). Use ``wrap_os_environ_io()`` to monkey-patch these wrappers into the\n``os`` module:\n\n.. code-block:: python\n\n import eight\n eight.wrap_os_environ_io()\n\nOn Python 3, the call is a no-op.\n\nSelecting from the buffet\n-------------------------\nYou can see what ``from eight import *`` will do by running `IPython `_ and typing\n``import eight``, then ``eight.``. Here is a full list of what's available:\n\n* ``ascii``\n* ``bytes``\n* ``chr``\n* ``filter``\n* ``hex``\n* ``input``\n* ``int``\n* ``map``\n* ``oct``\n* ``open``\n* ``range``\n* ``round``\n* ``str``\n* ``super``\n* ``zip``\n\nYou can import these symbols by listing them explicitly. If for any reason you see an issue with importing them all (which\nis recommended), you can of course import a subset.\n\nIn addition to names imported by ``from eight import *``, the following modules are available and should be imported by\nname using ``from eight import `` when needed:\n\n* ``queue`` (old name: ``Queue``)\n* ``builtins`` (old name: ``__builtin__``)\n* ``copyreg`` (old name: ``copy_reg``)\n* ``configparser`` (old name: ``ConfigParser``)\n* ``reprlib`` (old name: ``repr``)\n* ``winreg`` (old name: ``_winreg``)\n* ``_thread`` (old name: ``thread``)\n* ``_dummy_thread`` (old name: ``dummy_thread``)\n\nThe following modules have attributes which resided elsewhere in Python 2: TODO\n\nAcknowledgments\n---------------\n`Python-future `_ for doing a bunch of heavy lifting on backports of\nPython 3 features.\n\nLinks\n-----\n* `Project home page (GitHub) `_\n* `Documentation (Read the Docs) `_\n* `Package distribution (PyPI) `_\n\nBugs\n~~~~\nPlease report bugs, issues, feature requests, etc. on `GitHub `_.\n\nLicense\n-------\nLicensed under the terms of the `Apache License, Version 2.0 `_.\n\n.. image:: https://img.shields.io/travis/kislyuk/eight.svg\n :target: https://travis-ci.org/kislyuk/eight\n.. image:: https://codecov.io/github/kislyuk/eight/coverage.svg?branch=master\n :target: https://codecov.io/github/kislyuk/eight?branch=master\n.. image:: https://img.shields.io/pypi/v/eight.svg\n :target: https://pypi.python.org/pypi/eight\n.. image:: https://img.shields.io/pypi/l/eight.svg\n :target: https://pypi.python.org/pypi/eight\n.. image:: https://readthedocs.org/projects/eight/badge/?version=latest\n :target: https://eight.readthedocs.io/\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kislyuk/eight", "keywords": "", "license": "Apache Software License", "maintainer": "", "maintainer_email": "", "name": "eight", "package_url": "https://pypi.org/project/eight/", "platform": "MacOS X", "project_url": "https://pypi.org/project/eight/", "project_urls": { "Homepage": "https://github.com/kislyuk/eight" }, "release_url": "https://pypi.org/project/eight/0.4.2/", "requires_dist": null, "requires_python": "", "summary": "Python 2 to the power of 3. A lightweight porting helper library.", "version": "0.4.2" }, "last_serial": 2864864, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "127d683a595e08d11e8fd077d6b4bb70", "sha256": "8993bd58e49f0d0b32097aef9d6701c33f88b4b08c14419065f906c17bc6fcf4" }, "downloads": -1, "filename": "eight-0.0.1.tar.gz", "has_sig": false, "md5_digest": "127d683a595e08d11e8fd077d6b4bb70", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1974, "upload_time": "2014-01-06T23:27:54", "url": "https://files.pythonhosted.org/packages/0c/a8/f828c0226a9286c6e9d0853ff91c6a63df43ec1c5b81091b1142378f8bff/eight-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "5938f0015be67543ff67003980b5e847", "sha256": "6c499dbf7358015960263bf844a53a124e6402e58d67339ef818c864a0d7dffb" }, "downloads": -1, "filename": "eight-0.0.2.tar.gz", "has_sig": true, "md5_digest": "5938f0015be67543ff67003980b5e847", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2776, "upload_time": "2014-03-09T04:41:52", "url": "https://files.pythonhosted.org/packages/90/0f/e8df11fc99e1b4b644127cfc31577ee7bc693af9497e644b367ae1f7bfd9/eight-0.0.2.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "87c2d6b13f2d25f11603b68098cab0b3", "sha256": "0361e9907b2a334908d3c8b2dcb5e557f441243679544dfebe71c4e720b5c278" }, "downloads": -1, "filename": "eight-0.1.0.tar.gz", "has_sig": true, "md5_digest": "87c2d6b13f2d25f11603b68098cab0b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4572, "upload_time": "2014-03-31T14:53:31", "url": "https://files.pythonhosted.org/packages/16/03/02ac6cd2ba4fff50625071ef5f5f40d7d0cea5cfca7893e204545a1981eb/eight-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "be15e91c6973d066ab90637e2580a1aa", "sha256": "c8a6d98442fb0d967ef931fda9b173698c69ee72ebadd4182b6ca5b114ba06b3" }, "downloads": -1, "filename": "eight-0.1.1.tar.gz", "has_sig": true, "md5_digest": "be15e91c6973d066ab90637e2580a1aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5245, "upload_time": "2014-04-04T03:43:54", "url": "https://files.pythonhosted.org/packages/5c/1f/323693ea2966d39092bad2aeefa6430df0ab35eeb51ae618bead661c90fd/eight-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "acf7dc0a80c567bf3cfad2ad5b4f508c", "sha256": "3497fc688848002b76f4bf2be92cf9544693f0e65676f2cd73b34d812a76b744" }, "downloads": -1, "filename": "eight-0.1.2.tar.gz", "has_sig": true, "md5_digest": "acf7dc0a80c567bf3cfad2ad5b4f508c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5312, "upload_time": "2014-04-04T18:45:58", "url": "https://files.pythonhosted.org/packages/20/65/1301cc71781d77f0fb35b9cbdbfa697b76e1e6a430bfb129609ec67f42a8/eight-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "9f71d41a4832317e06c92454a3d2cd3b", "sha256": "62d7db94be0494a56cfa19cb7e3066a6f7328136df4707f42aa86c7fe62e5b72" }, "downloads": -1, "filename": "eight-0.1.3.tar.gz", "has_sig": true, "md5_digest": "9f71d41a4832317e06c92454a3d2cd3b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5386, "upload_time": "2014-04-04T18:48:52", "url": "https://files.pythonhosted.org/packages/ea/27/585bda999433ab6e1641fd983fabdd0d0676c440ff25c48d3d9058d4c220/eight-0.1.3.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "f1c355469eeea8fea01470a9e58610e5", "sha256": "5d3a222e241a5c0e3685839bb4d968a1a7398305750f45c96406cee13d4b5a83" }, "downloads": -1, "filename": "eight-0.2.0.tar.gz", "has_sig": true, "md5_digest": "f1c355469eeea8fea01470a9e58610e5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6037, "upload_time": "2014-04-22T00:27:30", "url": "https://files.pythonhosted.org/packages/00/70/4419df62461720b895de539093105843bc242a712cd43214f9e4dea19693/eight-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "aad58456f4998285ee94328bd7f06e9c", "sha256": "1620831a4040aad7ecff07410a69429eb5db6a471899117c62ac5c249df4259b" }, "downloads": -1, "filename": "eight-0.3.0.tar.gz", "has_sig": true, "md5_digest": "aad58456f4998285ee94328bd7f06e9c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6887, "upload_time": "2014-05-25T02:47:20", "url": "https://files.pythonhosted.org/packages/cc/2b/5a2918076aef3ee0225a271df6bbe1d2994815954efe52e8ba2d7f89c3cc/eight-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "b3d1b7dd93ed0b81bd968a7a7088daba", "sha256": "ad63ccd4f0bbc5533ecd266dbca478be45335d6e56ee93aba4a89b114500ca12" }, "downloads": -1, "filename": "eight-0.3.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "b3d1b7dd93ed0b81bd968a7a7088daba", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9826, "upload_time": "2015-05-09T04:19:28", "url": "https://files.pythonhosted.org/packages/10/27/fbceeb4b2933be5aa5883eec7150e52943931a8345f0750b6dd5eac80254/eight-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "31e67eaeef48aa69b092a99b576b9441", "sha256": "2ce29b1b535a15f6f947bac08df4fbd7f9431d0335dad34c1bce930fb1579a5f" }, "downloads": -1, "filename": "eight-0.3.1.tar.gz", "has_sig": true, "md5_digest": "31e67eaeef48aa69b092a99b576b9441", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7085, "upload_time": "2015-05-09T04:19:23", "url": "https://files.pythonhosted.org/packages/bb/51/fc7a73a9ab313e59fcc6e7a4ecc63754d7bbe5a4c5cff89be2a55114ac52/eight-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "e5021c200601b66c8d46e67aff0cf974", "sha256": "89e84d86d01f810393c8adb6188e7641f931abd88570b867ea8c463f1a86e96f" }, "downloads": -1, "filename": "eight-0.3.2-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "e5021c200601b66c8d46e67aff0cf974", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9831, "upload_time": "2015-05-09T04:30:58", "url": "https://files.pythonhosted.org/packages/1a/56/742770b647193590321a08b74049636453dc91a4cb1b538c090fd40beefd/eight-0.3.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "53febe1206482acba173c2d0103ef272", "sha256": "36a48fd991e54efa0944d741bf59b1f7f51d22267c043c8a392677758ae734b5" }, "downloads": -1, "filename": "eight-0.3.2.tar.gz", "has_sig": true, "md5_digest": "53febe1206482acba173c2d0103ef272", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7091, "upload_time": "2015-05-09T04:30:02", "url": "https://files.pythonhosted.org/packages/0f/f2/a506c55b0bd3a7f51839164e0c973636756f06c05df06da73fb02e4ae4b3/eight-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "318347d95548540751bb7b617a4fc5e9", "sha256": "d32d5b1684814179117a6be61ea54493630b8d18029b86e4fda004037a5a2883" }, "downloads": -1, "filename": "eight-0.3.3-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "318347d95548540751bb7b617a4fc5e9", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9843, "upload_time": "2015-11-06T15:42:49", "url": "https://files.pythonhosted.org/packages/5c/25/c834c3082156861ded0b167b061770f2709f7f7a498cb1ba43537e93ebb2/eight-0.3.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "61689d54903296b58b1e35f9ed84fd8a", "sha256": "b76605189e4484c769c4ee8d8029999756e2b35a4f6c71e4b40e5268400a98a6" }, "downloads": -1, "filename": "eight-0.3.3.tar.gz", "has_sig": true, "md5_digest": "61689d54903296b58b1e35f9ed84fd8a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7054, "upload_time": "2015-11-06T15:42:24", "url": "https://files.pythonhosted.org/packages/17/09/3a072285a591ea954a1466305a447b65938e10fa15be903beaebe0052e25/eight-0.3.3.tar.gz" } ], "0.4.0.dev0": [ { "comment_text": "", "digests": { "md5": "e0dc8140f9014b9d0f1509987137200f", "sha256": "4be79fc2ec5e715e16ffde982ba0f46d7d05062d4ddc5f083d800cbb068d17e1" }, "downloads": -1, "filename": "eight-0.4.0.dev0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "e0dc8140f9014b9d0f1509987137200f", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 10011, "upload_time": "2017-04-22T13:04:46", "url": "https://files.pythonhosted.org/packages/d5/4c/a9ee59c31b6e842d73e1643cf66fa1d6b7802ce64047342bdf3086b013ef/eight-0.4.0.dev0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9d421843406f0ec706445a4e12e54a05", "sha256": "cbd5aea026e4cd32e7f4ce08fe6def4b5059306b65701736cdc409d33af8b191" }, "downloads": -1, "filename": "eight-0.4.0.dev0.tar.gz", "has_sig": true, "md5_digest": "9d421843406f0ec706445a4e12e54a05", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11064, "upload_time": "2017-04-22T13:04:43", "url": "https://files.pythonhosted.org/packages/a4/2d/0d9563e33f9931d677aa91c183be574aaba0af50be28ea6c7062a2c9959d/eight-0.4.0.dev0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "731cc8abf3b29cb6516ffaeb0b7c5509", "sha256": "9759dc2b48f8b128bb1f2488405acdd292646d3bddf744e22ad0683f03fd63a7" }, "downloads": -1, "filename": "eight-0.4.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "731cc8abf3b29cb6516ffaeb0b7c5509", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9937, "upload_time": "2017-04-22T13:07:30", "url": "https://files.pythonhosted.org/packages/57/51/0785a3212aa8dc8a27f161ca8d88b190a86f7267bf3c13e085cc14a2e9d4/eight-0.4.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5d8dfdc4bc7e7cc1996856ee0e79b070", "sha256": "8f43362b7f4a1113e4f45bb05625d2655bdf91dbdb411545efb990b47c0c6889" }, "downloads": -1, "filename": "eight-0.4.1.tar.gz", "has_sig": true, "md5_digest": "5d8dfdc4bc7e7cc1996856ee0e79b070", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11047, "upload_time": "2017-04-22T13:07:27", "url": "https://files.pythonhosted.org/packages/98/31/c852711b7274886a22132d4f9b1d40c4a98f442bfa5090244f20ebc84374/eight-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "bd5302a2e4c09c547fc9e78f3bd3062a", "sha256": "b3ceecbfeb58fe68f726a69ac4225bbff554f5436c274646b75c63b039626c9e" }, "downloads": -1, "filename": "eight-0.4.2-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "bd5302a2e4c09c547fc9e78f3bd3062a", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9944, "upload_time": "2017-05-10T16:29:55", "url": "https://files.pythonhosted.org/packages/4a/93/ef92a6f172eaf8c35377f8ce96eaf2e59032af70ed1f044b65609c65c6f9/eight-0.4.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "28acbc4d7eae60effea4b881e749e7e7", "sha256": "eebadb79193c9a3ed95a74f59462267f05ca41c23a804f9f0dd80e597c9a9f8e" }, "downloads": -1, "filename": "eight-0.4.2.tar.gz", "has_sig": true, "md5_digest": "28acbc4d7eae60effea4b881e749e7e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11172, "upload_time": "2017-05-10T16:29:53", "url": "https://files.pythonhosted.org/packages/f5/f1/2dbb903ee7bb9c41528f616482075ddaf4ff1ede2ce1eedaa969a6f69e66/eight-0.4.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bd5302a2e4c09c547fc9e78f3bd3062a", "sha256": "b3ceecbfeb58fe68f726a69ac4225bbff554f5436c274646b75c63b039626c9e" }, "downloads": -1, "filename": "eight-0.4.2-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "bd5302a2e4c09c547fc9e78f3bd3062a", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9944, "upload_time": "2017-05-10T16:29:55", "url": "https://files.pythonhosted.org/packages/4a/93/ef92a6f172eaf8c35377f8ce96eaf2e59032af70ed1f044b65609c65c6f9/eight-0.4.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "28acbc4d7eae60effea4b881e749e7e7", "sha256": "eebadb79193c9a3ed95a74f59462267f05ca41c23a804f9f0dd80e597c9a9f8e" }, "downloads": -1, "filename": "eight-0.4.2.tar.gz", "has_sig": true, "md5_digest": "28acbc4d7eae60effea4b881e749e7e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11172, "upload_time": "2017-05-10T16:29:53", "url": "https://files.pythonhosted.org/packages/f5/f1/2dbb903ee7bb9c41528f616482075ddaf4ff1ede2ce1eedaa969a6f69e66/eight-0.4.2.tar.gz" } ] }