{ "info": { "author": "Youhei Sakurai", "author_email": "sakurai.youhei@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "\"\"lib2to3import\n===============\n\nlib2to3import is a utility to apply Python 2 to 3 code translation on import.\n\nw/o lib2to3import\n-------------------\n\n >>> from py2codes import py2_print\n Traceback (most recent call last):\n File \"\", line 1, in \n File \"py2codes/py2_print.py\", line 1\n print \"Written when Python 2 was majority.\"\n ^\n SyntaxError: Missing parentheses in call to 'print'\n\nWith lib2to3import\n--------------------\n\n >>> from lib2to3import import lib2to3importer, prepending\n >>> fixers = [\"lib2to3.fixes.fix_print\"]\n >>> with prepending(lib2to3importer(fixers, \"py2codes.\")):\n ... from py2codes import py2_print\n ...\n Written when Python 2 was majority.\n\nLimitation\n------------\n\nThere's no way to apply fixes to 2 different roots concurrently.\n\nWhen you apply fixes to both 'foo.module' and 'bar.module' at one time, you\nhave to leave out prefix parameter, that makes fixes applied to all of modules\nand packages to be imported.\n\n**Concurrent import**::\n\n from lib2to3import import lib2to3importer, prepending\n fixers = [\"lib2to3.fixes.fix_print\"]\n\n with prepending(lib2to3importer(fixers)):\n import foo.module # import chain: 1. foo.module -> 2. bar.module\n\n**2 steps import (Recommended)**::\n\n from lib2to3import import lib2to3importer, prepending\n fixers = [\"lib2to3.fixes.fix_print\"]\n\n with prepending(lib2to3importer(fixers, \"bar.\")):\n import bar.module # ... 2\n\n with prepending(lib2to3importer(fixers, \"foo.\")):\n import foo.module # ... 1", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/sakurai-youhei/lib2to3import", "keywords": "2to3,lib2to3,import,importer", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "lib2to3import", "package_url": "https://pypi.org/project/lib2to3import/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/lib2to3import/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/sakurai-youhei/lib2to3import" }, "release_url": "https://pypi.org/project/lib2to3import/2017.3.3.post2/", "requires_dist": null, "requires_python": null, "summary": "lib2to3import is a utility to apply Python 2 to 3 code translation on import.", "version": "2017.3.3.post2" }, "last_serial": 2679828, "releases": { "2017.3.2": [ { "comment_text": "", "digests": { "md5": "98c7d92cbd164e8a9545db32741798c2", "sha256": "5e5f8216c6e20f860b1b0e5e414b6143f298ae3ef3a2ac787d4bfdea71eea2a4" }, "downloads": -1, "filename": "lib2to3import-2017.3.2.zip", "has_sig": false, "md5_digest": "98c7d92cbd164e8a9545db32741798c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6882, "upload_time": "2017-03-02T10:00:40", "url": "https://files.pythonhosted.org/packages/93/33/5b206728b5b1fcc67042aa52f8bcb855778cdcda55563de46092c4d0e761/lib2to3import-2017.3.2.zip" } ], "2017.3.3": [ { "comment_text": "", "digests": { "md5": "0131196a9d319b009a84c0b358c24f45", "sha256": "df63a3eeac8c1156a1bffc98ae86e54d03aa8de878177cb0fc74ed425eba4fd7" }, "downloads": -1, "filename": "lib2to3import-2017.3.3.zip", "has_sig": false, "md5_digest": "0131196a9d319b009a84c0b358c24f45", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6833, "upload_time": "2017-03-02T10:19:35", "url": "https://files.pythonhosted.org/packages/e3/7a/8833628f6c76d4051aeedcb7f1b435cf3fc9c56570bb9e216723fac43332/lib2to3import-2017.3.3.zip" } ], "2017.3.3.post1": [ { "comment_text": "", "digests": { "md5": "24eb9d0a8d42967e8be23b2c1612e18f", "sha256": "33a06b53cf229e83bf8a32183887ad3c2a2d8201bd72012361534a16f4bb6f3a" }, "downloads": -1, "filename": "lib2to3import-2017.3.3.post1.zip", "has_sig": false, "md5_digest": "24eb9d0a8d42967e8be23b2c1612e18f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6990, "upload_time": "2017-03-03T01:13:39", "url": "https://files.pythonhosted.org/packages/78/12/35f3c61bdb069697225081ddbd468d5f42f769ca8100807cb62c771ad986/lib2to3import-2017.3.3.post1.zip" } ], "2017.3.3.post2": [ { "comment_text": "", "digests": { "md5": "ad8d85ff1432d5e6964328a9b7bf62a5", "sha256": "dee7904a06b97b3308bf5fe6c0cf3996a15fd8953eeba82dac189551505c8fc9" }, "downloads": -1, "filename": "lib2to3import-2017.3.3.post2.zip", "has_sig": false, "md5_digest": "ad8d85ff1432d5e6964328a9b7bf62a5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7060, "upload_time": "2017-03-03T07:51:02", "url": "https://files.pythonhosted.org/packages/69/99/33ea6493b6a7cbb920afb16e0b818215ea2585031b0e8998d397e3cb5a3c/lib2to3import-2017.3.3.post2.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ad8d85ff1432d5e6964328a9b7bf62a5", "sha256": "dee7904a06b97b3308bf5fe6c0cf3996a15fd8953eeba82dac189551505c8fc9" }, "downloads": -1, "filename": "lib2to3import-2017.3.3.post2.zip", "has_sig": false, "md5_digest": "ad8d85ff1432d5e6964328a9b7bf62a5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7060, "upload_time": "2017-03-03T07:51:02", "url": "https://files.pythonhosted.org/packages/69/99/33ea6493b6a7cbb920afb16e0b818215ea2585031b0e8998d397e3cb5a3c/lib2to3import-2017.3.3.post2.zip" } ] }