{ "info": { "author": "Daniel Perez", "author_email": "tuvistavie@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3" ], "description": "# bigcode-astgen-py\n\nGenerate Python files AST in a format compatible with [150k Python Dataset][1].\n\nThe code is mostly copied from [150k Python Dataset][1] and adapted to work with Python 3.\n\nNote that this tool will only be able to parse the version of Python it is running,\nas it is internally using Python `ast` module, which uses the current Python parser.\n\n## Install\n\nThis tool can be installed by running\n\n```\npip install bigcode-astgen\n```\n\nor by fetching this repository and running\n\n```\ncd ast-generators/python\npip install .\n```\n\n## CLI usage\n\n```\nbigcode-astgen-py -o \n```\n\n`` should be a file, or a glob expression to files.\n\n### Normal mode\n\nIn normal mode, `` is interpreted as a filename and the resulting AST\nis outputed in `` if provided, else printed to `stdout`.\n\n### Batch mode\n\nIn batch mode, `` is interpreted as a glob, and all matching files\nare parsed. `` is a prefix and `.json`, `.txt` and\n`_failed.txt` files will be created.\n\n* `.json` - contains a JSON formatted AST per line\n* `.txt` - contains a filename per line, in the same order as `.json`\n* `_failed.txt` - contains a filename per line, with the reason why it could not be parsed\n\n### Example\n\n#### Normal mode\n\n```\nbigcode-astgen-py bigcode_astgen/normalizer.py\n```\n\nparse `bigcode_astgen/normalizer.py` and output the result to stdout.\n\n#### Batch mode\n\n```\nbigcode-astgen-py --batch -o result/asts \"src/**/*.py\"\n```\n\nparse all `.py` files in `src` directory and output results in the `result` directory\nwith the prefix `asts`.\n\n\n## Python API\n\n### `bigcode_astgen.ast_generator.parse_string`\n\nReturns the AST nodes of the given string\n\nArgs:\n\n* `content`: string containing a Python program\n\n\n### `bigcode_astgen.ast_generator.parse_file`\n\nReturns the AST nodes of the given file\n\nArgs:\n\n* `filename`: path to a file containing a Python program\n\n### `bigcode_astgen.ast_bulk_processor.process_files`\n\nProcess all the files matched with the `files_pattern` and output the results in `output_dir`\n\nArgs:\n\n* `files_pattern`: a glob pattern containing python files\n* `output`: the filename (without extension) where to output results\n\n## License\n\nI could not find the license of [150k Python Dataset][1] source code from which\n`bigcode_astgen/ast_generator.py` is copied.\nTherefore, until further notice, this project does not follow the MIT license as the rest of the repository.\n\n\n[1]: http://www.srl.inf.ethz.ch/py150.php\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/tuvistavie/bigcode-tools/archive/master.zip", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tuvistavie/bigcode-tools/tree/master/bigcode-astgen/python", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "bigcode-astgen", "package_url": "https://pypi.org/project/bigcode-astgen/", "platform": "", "project_url": "https://pypi.org/project/bigcode-astgen/", "project_urls": { "Download": "https://github.com/tuvistavie/bigcode-tools/archive/master.zip", "Homepage": "https://github.com/tuvistavie/bigcode-tools/tree/master/bigcode-astgen/python" }, "release_url": "https://pypi.org/project/bigcode-astgen/0.2.1/", "requires_dist": [ "tox; extra == 'test'", "nose; extra == 'test'" ], "requires_python": "", "summary": "Tool to search and fetch code from GitHub", "version": "0.2.1" }, "last_serial": 3302337, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "266ebbe07a9706151f88d2c84da877aa", "sha256": "f0dfdd19c8860aaa736836b2fb9303520ace4c46ff939a90eb73638bf7e3e83d" }, "downloads": -1, "filename": "bigcode_astgen-0.1.0-py3-none-any.whl", "has_sig": true, "md5_digest": "266ebbe07a9706151f88d2c84da877aa", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14439, "upload_time": "2017-10-10T02:23:28", "url": "https://files.pythonhosted.org/packages/cf/d8/c95d5f41e97d6b9dbf09cfb4ca845dc295efe50f91c9cde59b70532f401b/bigcode_astgen-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f14258eabe70797cfb953deab3aa42ad", "sha256": "bbd80f2bf82294da61c67dfa4ec5a8b99fd18c7bf88f108afee7213eee11d55c" }, "downloads": -1, "filename": "bigcode-astgen-0.1.0.tar.gz", "has_sig": true, "md5_digest": "f14258eabe70797cfb953deab3aa42ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6351, "upload_time": "2017-10-10T02:23:29", "url": "https://files.pythonhosted.org/packages/be/4e/bf252041b801e21ba6788147c6bea04f6c704a6c4592b64091756b799bd5/bigcode-astgen-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "38dd33e42d08bf84b412dceb399688ec", "sha256": "d56b1bcb73c01a118380906941ee8649b46d23f9585fff174cc638bbaa110ddc" }, "downloads": -1, "filename": "bigcode_astgen-0.1.1-py3-none-any.whl", "has_sig": true, "md5_digest": "38dd33e42d08bf84b412dceb399688ec", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9340, "upload_time": "2017-10-11T05:05:00", "url": "https://files.pythonhosted.org/packages/96/fc/11f662ff097135fad00ba8390929cfae4f98b6593fc986057fee56176835/bigcode_astgen-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "123a3728566eed40effeef2818f934cc", "sha256": "fa01061b38b84ab2938d009c52be149daea5cc358d1da84e15307a0cb9b1c0b0" }, "downloads": -1, "filename": "bigcode-astgen-0.1.1.tar.gz", "has_sig": true, "md5_digest": "123a3728566eed40effeef2818f934cc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6325, "upload_time": "2017-10-11T05:05:02", "url": "https://files.pythonhosted.org/packages/20/dd/fccb8510149f466bc10dca5a3cad8d59935bcc2a43c4981d94ce0e60c99a/bigcode-astgen-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "3861070c45c688bfc07e0dc844f524fe", "sha256": "870a33bab055f9c8e3708ca3cde562a5789293ad987e9a69e4c697dd19739a19" }, "downloads": -1, "filename": "bigcode_astgen-0.1.2-py3-none-any.whl", "has_sig": true, "md5_digest": "3861070c45c688bfc07e0dc844f524fe", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10519, "upload_time": "2017-10-13T07:39:10", "url": "https://files.pythonhosted.org/packages/87/c2/41c341f99553171840b9d18d289214d5fc8f448ba718610eb6072452317a/bigcode_astgen-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "947b567a87c099d6150d9d9929b91616", "sha256": "44a4d29aed3b6597f0c6b5fad848ec337e8cbd6113e18f429d05ce2a6117059e" }, "downloads": -1, "filename": "bigcode-astgen-0.1.2.tar.gz", "has_sig": true, "md5_digest": "947b567a87c099d6150d9d9929b91616", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7216, "upload_time": "2017-10-13T07:39:11", "url": "https://files.pythonhosted.org/packages/fb/69/af697751ebf095ec61a55d9a2790733496d2d59cb8358033932c4410e4f9/bigcode-astgen-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "cd192270b3c4e0cbed3f732dbe12286e", "sha256": "bf4d9e04cda44b7742d55aeddfa7dbf4136109aac528908c1e13e7bdece98735" }, "downloads": -1, "filename": "bigcode_astgen-0.2.0-py3-none-any.whl", "has_sig": true, "md5_digest": "cd192270b3c4e0cbed3f732dbe12286e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11937, "upload_time": "2017-11-03T04:07:37", "url": "https://files.pythonhosted.org/packages/1f/64/136a80db7fb5029d01aaec251ea0eaf525b7ad71aad5799fe94c109dfc1e/bigcode_astgen-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "433ae8443b72e207130edd3466c771aa", "sha256": "ba55b321e22e9cfc2153c5d94dcaa714d95e772b0775e4633c78e0b9bbb8638d" }, "downloads": -1, "filename": "bigcode-astgen-0.2.0.tar.gz", "has_sig": true, "md5_digest": "433ae8443b72e207130edd3466c771aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8109, "upload_time": "2017-11-03T04:07:38", "url": "https://files.pythonhosted.org/packages/ae/6e/c1511addfc2c35bdbb688202c5893e6e706cee27107d0e96a458627a3fbf/bigcode-astgen-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "2e77ef0a2ac79a76b8684f0679fb0023", "sha256": "9c50ee77bd90e5031b35180c852a48210ef6e899faa8f134dfbb7eaf3c8a4362" }, "downloads": -1, "filename": "bigcode_astgen-0.2.1-py3-none-any.whl", "has_sig": true, "md5_digest": "2e77ef0a2ac79a76b8684f0679fb0023", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11944, "upload_time": "2017-11-03T06:16:16", "url": "https://files.pythonhosted.org/packages/b9/72/5f9282ca476f917a969fe1ebf6f0ce947aef99b312430a96a26a7bc439c5/bigcode_astgen-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "44687b963c7845e66a62fc23f15a7869", "sha256": "fbb3371c2a8ba7198d4ecd6b92e62dfe67859b5911f99a6087acced2bb05f838" }, "downloads": -1, "filename": "bigcode-astgen-0.2.1.tar.gz", "has_sig": true, "md5_digest": "44687b963c7845e66a62fc23f15a7869", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8111, "upload_time": "2017-11-03T06:16:17", "url": "https://files.pythonhosted.org/packages/4c/b4/9a64c11d1833baddc9abeff5735972faafbf7bd22b11357d27cd76390365/bigcode-astgen-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2e77ef0a2ac79a76b8684f0679fb0023", "sha256": "9c50ee77bd90e5031b35180c852a48210ef6e899faa8f134dfbb7eaf3c8a4362" }, "downloads": -1, "filename": "bigcode_astgen-0.2.1-py3-none-any.whl", "has_sig": true, "md5_digest": "2e77ef0a2ac79a76b8684f0679fb0023", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11944, "upload_time": "2017-11-03T06:16:16", "url": "https://files.pythonhosted.org/packages/b9/72/5f9282ca476f917a969fe1ebf6f0ce947aef99b312430a96a26a7bc439c5/bigcode_astgen-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "44687b963c7845e66a62fc23f15a7869", "sha256": "fbb3371c2a8ba7198d4ecd6b92e62dfe67859b5911f99a6087acced2bb05f838" }, "downloads": -1, "filename": "bigcode-astgen-0.2.1.tar.gz", "has_sig": true, "md5_digest": "44687b963c7845e66a62fc23f15a7869", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8111, "upload_time": "2017-11-03T06:16:17", "url": "https://files.pythonhosted.org/packages/4c/b4/9a64c11d1833baddc9abeff5735972faafbf7bd22b11357d27cd76390365/bigcode-astgen-0.2.1.tar.gz" } ] }