{ "info": { "author": "Ariel Antonitis", "author_email": "arant@mit.edu", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Code Generators" ], "description": ".. |pypi| image:: https://img.shields.io/pypi/v/xylem.svg\n.. _pypi: https://pypi.python.org/pypi/xylem\n.. |license| image:: https://img.shields.io/github/license/arantonitis/xylem.svg\n.. _license: https://github.com/arantonitis/xylem/tree/master/LICENSE\n\nXylem\n*****\n|pypi|_ |license|_\n\nConvert Python Abstract Syntax Trees (ASTs) to readable source code.\n\nXylem is useful for when you want to make dynamic changes to Python code/ASTs, but also need to write those changes back as source code.\n\nIt's also very small (<500 lines), pure-Python, and produces (mostly) readable source code.\n\nIn writing this, I made heavy use of the unofficial AST documentation at `Green Tree Snakes`_.\n\n.. _Green Tree Snakes: https://greentreesnakes.readthedocs.io\n\nInstallation\n============\nXylem will work on Python 3.4 or later. I'll eventually get around to testing it on Python 2.7-3.3.\n\nFrom PyPI\n---------\nInstall Xylem by running ``pip3 install xylem`` from the command line.\n\n.. note::\n\n On some Linux systems, installation may require running pip with root permissions, or running ``pip3 install xylem --user``. The latter may require exporting `~/.local/bin` to PATH.\n \nFrom GitHub\n-----------\nClone or download the `git repo`_, navigate to the directory, and run::\n\n python3 setup.py sdist\n cd dist\n pip3 install xylem-.tar.gz\n \n.. _git repo: https://github.com/arantonitis/xylem\n\nUsage\n=====\n``to_source`` is likely the only method you'll need to use:\n\n.. code-block:: python\n\n >>> from xylem import to_source\n >>> import ast\n >>> tree = ast.parse(\"print('hello world')\")\n >>> ast.dump(tree)\n \"Module(body=[Expr(value=Call(func=Name(id='print', ctx=Load()), args=[Str(s='Hello world')], keywords=[]))])\"\n >>> to_source(tree)\n \"print('hello world')\"\n\n``compare_ast`` may also be useful for determining if two ASTs are functionally equivalent.\n\nDevelopment\n===========\nXylem versioning functions on a ``MAJOR.MINOR.PATCH.[DEVELOP]`` model. Only stable, non development releases will be published to PyPI. Because Xylem is still a beta project, the ``MAJOR`` increment will be 0. Minor increments represent new features. Patch increments represent problems fixed with existing features.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/arantonitis/xylem", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "xylem", "package_url": "https://pypi.org/project/xylem/", "platform": "", "project_url": "https://pypi.org/project/xylem/", "project_urls": { "Homepage": "https://github.com/arantonitis/xylem" }, "release_url": "https://pypi.org/project/xylem/0.10.0/", "requires_dist": null, "requires_python": "", "summary": "Convert Python Abstract Syntax Trees to readable source code", "version": "0.10.0" }, "last_serial": 4477009, "releases": { "0.10.0": [ { "comment_text": "", "digests": { "md5": "8b723a3ee2270231913283faf435fd4f", "sha256": "3bfd065b785c10704e9f2a07d168e66fe381b1cdc245fc5a067967b02565efce" }, "downloads": -1, "filename": "xylem-0.10.0.tar.gz", "has_sig": false, "md5_digest": "8b723a3ee2270231913283faf435fd4f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7233, "upload_time": "2018-11-12T10:58:03", "url": "https://files.pythonhosted.org/packages/ed/5c/4997d1c599a235b75cb0d60a487a0097b1a8dcd9f5878906c2be2fd87fc9/xylem-0.10.0.tar.gz" } ], "0.9.0": [ { "comment_text": "", "digests": { "md5": "d8c157964a847a59514cac5af49b45b4", "sha256": "bfec2b47323c2e7fd96eedf4b9a78eb708c42def155b161af7625d8323ef64bf" }, "downloads": -1, "filename": "xylem-0.9.0.tar.gz", "has_sig": false, "md5_digest": "d8c157964a847a59514cac5af49b45b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7265, "upload_time": "2018-11-12T08:24:26", "url": "https://files.pythonhosted.org/packages/9b/76/8b1f5c2c55a1fc1346b589b8873af33e18976cb793b84855dba2b09fef2e/xylem-0.9.0.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "5342c547fd19901edd06782df445c7f9", "sha256": "825f0944d9f4fb0097d3e86e02da7870231a75f28a3a7b59b6813fd3d227c6a1" }, "downloads": -1, "filename": "xylem-0.9.1.tar.gz", "has_sig": false, "md5_digest": "5342c547fd19901edd06782df445c7f9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7277, "upload_time": "2018-11-12T09:01:40", "url": "https://files.pythonhosted.org/packages/5c/a3/f5d3fa709fab2ab311d5ca73099c46e3413828d658d6931b0c90ff82e32b/xylem-0.9.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8b723a3ee2270231913283faf435fd4f", "sha256": "3bfd065b785c10704e9f2a07d168e66fe381b1cdc245fc5a067967b02565efce" }, "downloads": -1, "filename": "xylem-0.10.0.tar.gz", "has_sig": false, "md5_digest": "8b723a3ee2270231913283faf435fd4f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7233, "upload_time": "2018-11-12T10:58:03", "url": "https://files.pythonhosted.org/packages/ed/5c/4997d1c599a235b75cb0d60a487a0097b1a8dcd9f5878906c2be2fd87fc9/xylem-0.10.0.tar.gz" } ] }