{ "info": { "author": "Seunghwan Hong", "author_email": "harrydrippin@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "Intended Audience :: Education", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Natural Language :: Korean", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython" ], "description": "# Dismantler\n[![PyPI version](https://img.shields.io/pypi/v/dismantler-python.svg)](https://badge.fury.io/py/dismantler-python)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)]()\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/dismantler-python.svg)\n[![Say Thanks](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/harrydrippin)\n\n```\n\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \n\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255d\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u255a\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255d\u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255d\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\n\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255d\n\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u255a\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2551\u255a\u2588\u2588\u2554\u255d\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2551\u255a\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u255d \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\n\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255d\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u255a\u2550\u255d \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u255a\u2588\u2588\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\n\u255a\u2550\u2550\u2550\u2550\u2550\u255d \u255a\u2550\u255d\u255a\u2550\u2550\u2550\u2550\u2550\u2550\u255d\u255a\u2550\u255d \u255a\u2550\u255d\u255a\u2550\u255d \u255a\u2550\u255d\u255a\u2550\u255d \u255a\u2550\u2550\u2550\u255d \u255a\u2550\u255d \u255a\u2550\u2550\u2550\u2550\u2550\u2550\u255d\u255a\u2550\u2550\u2550\u2550\u2550\u2550\u255d\u255a\u2550\u255d \u255a\u2550\u255d\n```\nThis module dismantles python code to parse tree, token, symbols and reproduces it to dictionary and string.\n\n## What is this?\n\nDismantler takes a Python code as input and creates a parse tree in a short time. It also export the parse tree to a dictionary or json. You can get list of tokens or symbols separately if you want. This project can be used for research purpose, such as teaching the source code to deep learning model as tokenized sequential data or interpreting the Python code on token level and using it for educational programs (like tutoring).\n\n## Basic Usage\n\n```\nimport dismantler\n\nd = dismantler.run_from_string('a + 5').dictionary()\nprint(d)\n{\n \"type\": \"symbol\",\n \"name\": \"stmt\",\n \"value\": [\n // Nodes...\n ]\n}\n\nd = dismantler.run_from_file('file.py').json(indent=4)\nprint(d)\n\"{\n \"type\": \"symbol\",\n \"name\": \"stmt\",\n \"value\": [\n // Nodes...\n ]\n}\"\n```\n\n## Installation\n\n### Via pip\n```bash\npip3 install dismantler-python\n```\n\n### Via source\n```bash\ngit clone http://github.com/harrydrippin/dismantler-python\n```\n\n## Contribution\n\nThis project is very small now, so contribution to this project is very welcome. Feel free to submit some issues or PRs to this project.\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://harrydrippin.github.io/dismantler-python", "keywords": "", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "dismantler-python", "package_url": "https://pypi.org/project/dismantler-python/", "platform": "", "project_url": "https://pypi.org/project/dismantler-python/", "project_urls": { "Homepage": "http://harrydrippin.github.io/dismantler-python" }, "release_url": "https://pypi.org/project/dismantler-python/0.0.2/", "requires_dist": null, "requires_python": ">=3.4, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "summary": "This module dismantles python code to parse tree, token, symbols and reproduces it to dictionary and string.", "version": "0.0.2" }, "last_serial": 4064879, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "5ca07079b7264c36964fc2855954d3ef", "sha256": "66682fcb3d479d15f4fe8c64ef5ca0f413abebc0a5c41cac0821838ad10b3dcf" }, "downloads": -1, "filename": "dismantler_python-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "5ca07079b7264c36964fc2855954d3ef", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 5292, "upload_time": "2018-07-16T07:45:06", "url": "https://files.pythonhosted.org/packages/f0/7a/40cfc69f0482ad3eac3f7eaae8f245b5b25cfc8b236f67a8d07ff7ef5f9c/dismantler_python-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d193bffe5a811fec0959d28f41b39a3b", "sha256": "c27e380e2bded1ae8b71ad5398a9f7322d1cb137e7b186350de9569034128239" }, "downloads": -1, "filename": "dismantler-python-0.0.1.tar.gz", "has_sig": false, "md5_digest": "d193bffe5a811fec0959d28f41b39a3b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 3910, "upload_time": "2018-07-16T07:45:07", "url": "https://files.pythonhosted.org/packages/e4/94/74ecb3938cd73b8473c1f09cb161d6f97cd3b19c1cf35905701f4d6568cd/dismantler-python-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "1b1c1f20ad91ef7fea106d5d32ba9264", "sha256": "182fa5f9d3d68c8d46ec61d6d50ca4b6c69b4e97a65c9f8e81c6d708f40a042a" }, "downloads": -1, "filename": "dismantler_python-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "1b1c1f20ad91ef7fea106d5d32ba9264", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 6146, "upload_time": "2018-07-16T08:10:22", "url": "https://files.pythonhosted.org/packages/b5/82/66195e99e0fdfb341341f153e93ccca5da65ad9ded93815271b9f3868cd3/dismantler_python-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "06cbdbd136bc3cdf574329732bb10ed6", "sha256": "e9cdd4bf4cd69379587ad342dc84e9ab621c86cc56be2b2a1ce74604eec61790" }, "downloads": -1, "filename": "dismantler-python-0.0.2.tar.gz", "has_sig": false, "md5_digest": "06cbdbd136bc3cdf574329732bb10ed6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 4680, "upload_time": "2018-07-16T08:10:24", "url": "https://files.pythonhosted.org/packages/22/fd/4b10aa4abdbbf653a2182c72ab8cd94d3f6c7f052f28ef80a633fe123fd9/dismantler-python-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1b1c1f20ad91ef7fea106d5d32ba9264", "sha256": "182fa5f9d3d68c8d46ec61d6d50ca4b6c69b4e97a65c9f8e81c6d708f40a042a" }, "downloads": -1, "filename": "dismantler_python-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "1b1c1f20ad91ef7fea106d5d32ba9264", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 6146, "upload_time": "2018-07-16T08:10:22", "url": "https://files.pythonhosted.org/packages/b5/82/66195e99e0fdfb341341f153e93ccca5da65ad9ded93815271b9f3868cd3/dismantler_python-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "06cbdbd136bc3cdf574329732bb10ed6", "sha256": "e9cdd4bf4cd69379587ad342dc84e9ab621c86cc56be2b2a1ce74604eec61790" }, "downloads": -1, "filename": "dismantler-python-0.0.2.tar.gz", "has_sig": false, "md5_digest": "06cbdbd136bc3cdf574329732bb10ed6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 4680, "upload_time": "2018-07-16T08:10:24", "url": "https://files.pythonhosted.org/packages/22/fd/4b10aa4abdbbf653a2182c72ab8cd94d3f6c7f052f28ef80a633fe123fd9/dismantler-python-0.0.2.tar.gz" } ] }