{ "info": { "author": "Sergey Satskiy", "author_email": "sergey.satskiy@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Operating System :: POSIX :: Linux", "Programming Language :: C", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "cdm-pythonparser \n-------------------------------\n\n`cdm-pythonparser\nproject `__ is a\nPython 3 (Python 2 support is limited) extension module. The module\nprovided functions can take a file with a python code or a character\nbuffer, parse it and provide back what is found in the code: functions,\nclasses, global variables etc.\n\nThe module is used in the `Codimension Python\nIDE `__ to show in a structured way a content of\nan arbitrary python code and for some other features however, it could\nbe used in other projects which need a python code retrospection.\n\nPython 3 Installation and Building\n----------------------------------\n\nThe `master\nbranch `__ on github\ncontains code for Python 3 (3.5/3.6/3.7 grammar is covered).\n\nThe module can be installed using pip:\n\n.. code:: shell\n\n pip install cdmpyparser\n\nYou can also retrieve the full source code which in addition has some\nutilities. In order to do that you can follow these steps:\n\n.. code:: shell\n\n git clone https://github.com/SergeySatskiy/cdm-pythonparser.git\n cd cdm-pythonparser\n make\n make check\n make localinstall\n\nPython 3 Usage\n--------------\n\nSuppose there is the following file ~/my-file.py with the following\ncontent:\n\n.. code:: python\n\n #!/bin/env python\n import sys\n\n # global variable\n a = 154\n\n class C(BaseClass):\n \"\"\"Class docstring\"\"\"\n @staticmethod\n def getValue(arg):\n \"\"\"Method docstring\"\"\"\n return arg + 154\n\nThen the following python session may take place:\n\n.. code:: shell\n\n $ python\n Python 3.6.2 (default, Aug 9 2017, 11:11:12)\n [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux\n Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n >>> import cdmpyparser\n >>> c = cdmpyparser.getBriefModuleInfoFromFile('my-file.py')\n >>> print(c.niceStringify())\n Import[2:8:25]: 'sys'\n Global[5:1:48]: 'a'\n Class[7:1:7:7:63:7:19]: 'C'\n Base class: 'BaseClass'\n Docstring[8]: 'Class docstring'\n Function[10:5:10:9:129:10:22]: 'getValue'\n Argument: 'arg'\n Decorator[9:6:108]: 'staticmethod\n Docstring[11]: 'Method docstring'\n >>> len(c.imports)\n 1\n >>> c.imports[0].name\n 'sys'\n >>> c.imports[0].line\n 2\n >>> c.imports[0].pos\n 8\n\n**Note:** Python 3 and Python 2 modules use different names. Python 3\nuses ``cdmpyparser``. Python 2 uses ``cdmbriefparser``.\n\nSee the 'cdmpyparser.py' file for the members which are supplied along\nwith all the recognized items.\n\nPython 2 Installation and Building\n----------------------------------\n\n**Attention:** Python 2 version is not supported anymore. There will be\nno more Python 2 releases.\n\nThe latest Python 2 release is 2.0.1. Both pre-built modules and source\ncode are available in the releases area on github: `latest Python 2\nrelease\n2.0.1 `__.\n\nTo build a Python 2 module from sources please follow these steps:\n\n.. code:: shell\n\n cd\n wget https://github.com/SergeySatskiy/cdm-pythonparser/archive/v2.0.1.tar.gz\n gunzip v2.0.1.tar.gz\n tar -xf v2.0.1.tar\n cd cdm-pythonparser-2.0.1/\n make\n make localinstall\n make check\n\nPython 2 Usage\n--------------\n\nSuppose there is the following file ~/my-file.py with the following\ncontent:\n\n.. code:: python\n\n #!/bin/env python\n import sys\n\n # global variable\n a = 154\n\n class C(BaseClass):\n \"\"\"Class docstring\"\"\"\n @staticmethod\n def getValue(arg):\n \"\"\"Method docstring\"\"\"\n return arg + 154\n\nThen the following python session may take place:\n\n.. code:: shell\n\n $ python\n Python 2.7.12 (default, Sep 13 2016, 16:46:03)\n [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2\n Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n >>> import cdmbriefparser\n >>> c = cdmbriefparser.getBriefModuleInfoFromFile('my-file.py')\n >>> print c.niceStringify()\n Import[2:8:25]: 'sys'\n Global[5:1:48]: 'a'\n Class[7:1:7:7:63:7:19]: 'C'\n Base class: 'BaseClass'\n Docstring[8]: 'Class docstring'\n Function[10:5:10:9:129:10:22]: 'getValue'\n Argument: 'arg'\n Decorator[9:6:108]: 'staticmethod\n Docstring[11]: 'Method docstring'\n >>> len(c.imports)\n 1\n >>> c.imports[0].name\n 'sys'\n >>> c.imports[0].line\n 2\n >>> c.imports[0].pos\n 8\n\n**Note:** Python 3 and Python 2 modules use different names. Python 3\nuses ``cdmpyparser``. Python 2 uses ``cdmbriefparser``.\n\nSee the 'cdmbriefparser.py' file for the members which are supplied\nalong with all the recognized items.\n\nComparison to the Standard pyclbr Module\n----------------------------------------\n\n**Note:** the comparison results are provided for the Python 2 module.\nThe Python 3 module yeilds pretty much the same results in terms of\nperformance while extracts more information because the grammar was\nextended for Python 3.\n\nThe table below shows the comparison between the standard ``pyclbr``\nmodule and the Codimension's ``cdmbriefparser`` module.\n\n+--------------+-------------+---------------------+\n| *feature* | *pyclbr* | *cdmbriefparser* |\n+==============+=============+=====================+\n| Extracting | N | Y |\n| coding | | |\n| string | | |\n+--------------+-------------+---------------------+\n| Extracting | N | Y |\n| module | | |\n| docstring | | |\n+--------------+-------------+---------------------+\n| Extracting | N | Y |\n| global | | |\n| variables | | |\n+--------------+-------------+---------------------+\n| Extracting | N | Y |\n| imports | | |\n+--------------+-------------+---------------------+\n| Extracting | Y | Y |\n| top level | | |\n| functions | | |\n+--------------+-------------+---------------------+\n| Extracting | N | Y |\n| nested | | |\n| functions | | |\n+--------------+-------------+---------------------+\n| Extracting | N | Y |\n| functions | | |\n| arguments | | |\n+--------------+-------------+---------------------+\n| Extracting | N | Y |\n| functions | | |\n| docstrings | | |\n+--------------+-------------+---------------------+\n| Extracting | N | Y |\n| functions | | |\n| decorators | | |\n+--------------+-------------+---------------------+\n| Extracting | Y | Y |\n| classes | | |\n+--------------+-------------+---------------------+\n| Extracting | Y | Y |\n| base classes | | |\n+--------------+-------------+---------------------+\n| Extracting | N | Y |\n| class | | |\n| attributes | | |\n+--------------+-------------+---------------------+\n| Extracting | N | Y |\n| class | | |\n| instance | | |\n| attributes | | |\n+--------------+-------------+---------------------+\n| Extracting | Y | Y |\n| class | | |\n| methods | | |\n+--------------+-------------+---------------------+\n| Extracting | N | Y |\n| class | | |\n| methods | | |\n| arguments | | |\n+--------------+-------------+---------------------+\n| Extracting | N | Y |\n| nested | | |\n| classes | | |\n+--------------+-------------+---------------------+\n| Extracting | N | Y |\n| classes | | |\n| docstrings | | |\n+--------------+-------------+---------------------+\n| Extracting | N | Y |\n| class | | |\n| methods | | |\n| docstrings | | |\n+--------------+-------------+---------------------+\n| Extracting | N | Y |\n| classes | | |\n| decorators | | |\n+--------------+-------------+---------------------+\n| Extracting | N | Y |\n| decorators | | |\n| arguments | | |\n+--------------+-------------+---------------------+\n| Keeping the | N | Y |\n| hierarchy of | | |\n| the | | |\n| classes/func | | |\n| tions | | |\n| of the | | |\n| arbitrary | | |\n| depth | | |\n+--------------+-------------+---------------------+\n| Ability to | Y (silent) | Y (error messages |\n| work with | | are provided) |\n| partially | | |\n| syntacticall | | |\n| y | | |\n| correct | | |\n| files | | |\n+--------------+-------------+---------------------+\n| Ability to | Y | Y |\n| parse python | | |\n| code from a | | |\n| file | | |\n+--------------+-------------+---------------------+\n| Ability to | N | Y |\n| parse python | | |\n| code from | | |\n| memory | | |\n+--------------+-------------+---------------------+\n| Extracting | N | Y |\n| classes and | | |\n| functions | | |\n| with the | | |\n| same names | | |\n+--------------+-------------+---------------------+\n| Supported | ANY | Up to 2.7 (series 3 |\n| python | | has not been |\n| version | | tested) |\n+--------------+-------------+---------------------+\n| Time to | 2 min 37 | 24 sec |\n| process | sec | |\n| 11365 python | | |\n| files | | |\n| (python 2.7 | | |\n| distribution | | |\n| and some | | |\n| third party | | |\n| packages). | | |\n+--------------+-------------+---------------------+\n\nEssential Links\n---------------\n\n- `Codimension Python IDE `__ home page\n- `latest Python 2 release\n 2.0.1 `__\n- `Python 3 Pypi\n package `__\n page\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/SergeySatskiy/cdm-pythonparser", "keywords": "", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "cdmpyparser", "package_url": "https://pypi.org/project/cdmpyparser/", "platform": "any", "project_url": "https://pypi.org/project/cdmpyparser/", "project_urls": { "Homepage": "https://github.com/SergeySatskiy/cdm-pythonparser" }, "release_url": "https://pypi.org/project/cdmpyparser/3.1.1/", "requires_dist": null, "requires_python": "", "summary": "Fast and comprehensive Python language parser. Written as a part of the Codimension project, this parser aims at pulling the most data from Python sources while exceeding the speed of existing parsers.", "version": "3.1.1" }, "last_serial": 5602789, "releases": { "3.0.0": [ { "comment_text": "", "digests": { "md5": "1db3c4ca2524bfe94c59060eb813e2c5", "sha256": "39294de350db3884715cde9290e932f7aa1ddc75ec21a4e90e14e4a88dd26baf" }, "downloads": -1, "filename": "cdmpyparser-3.0.0.tar.gz", "has_sig": false, "md5_digest": "1db3c4ca2524bfe94c59060eb813e2c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 42333, "upload_time": "2017-08-21T03:59:42", "url": "https://files.pythonhosted.org/packages/53/d7/ac57904695c662aa2af4d4d27c826a11d9731d997c87708d3162cf17ae7f/cdmpyparser-3.0.0.tar.gz" } ], "3.0.1": [ { "comment_text": "", "digests": { "md5": "ce470d2daac0b86b1525487647cfffe4", "sha256": "cbb80d8131e093674a190852b51228ed0a46dd637fd096b8b63921090916a87d" }, "downloads": -1, "filename": "cdmpyparser-3.0.1.tar.gz", "has_sig": false, "md5_digest": "ce470d2daac0b86b1525487647cfffe4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 42605, "upload_time": "2017-08-22T00:35:24", "url": "https://files.pythonhosted.org/packages/a6/ea/71c1cdf67a363015c89ce6e754668e2e8930cda20d8409abfb044d6335c9/cdmpyparser-3.0.1.tar.gz" } ], "3.0.2": [ { "comment_text": "", "digests": { "md5": "955d57fa808ffc7fbbbf16fca82f6019", "sha256": "30b52b1fb1cd1537f791d224ca10e7a72b42ad5e4854aff22dae2ada98e9e621" }, "downloads": -1, "filename": "cdmpyparser-3.0.2.tar.gz", "has_sig": false, "md5_digest": "955d57fa808ffc7fbbbf16fca82f6019", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 42818, "upload_time": "2017-11-17T03:41:48", "url": "https://files.pythonhosted.org/packages/9b/c2/09b4bde3c706eeb9de8902f1bfd1436854650cc085f8ba3130bb1c61dcec/cdmpyparser-3.0.2.tar.gz" } ], "3.0.3": [ { "comment_text": "", "digests": { "md5": "e8ccf86d1717be1376499314745d74de", "sha256": "aba2e78e09859bd885f6f32664d5d8371b45fae6d1921b449d50ab84b731eec5" }, "downloads": -1, "filename": "cdmpyparser-3.0.3.tar.gz", "has_sig": false, "md5_digest": "e8ccf86d1717be1376499314745d74de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 42855, "upload_time": "2018-08-02T02:43:31", "url": "https://files.pythonhosted.org/packages/57/f1/ff694f525da35487ce8d95e8310d559c453095c75b14bb5092eec1bf68da/cdmpyparser-3.0.3.tar.gz" } ], "3.1.0": [ { "comment_text": "", "digests": { "md5": "bd89881ae0f30e40922ce170b4e144e8", "sha256": "680c037f5c0ac15baddd0ded043e59b3a24735995abba2ca9aa9a3d57a720938" }, "downloads": -1, "filename": "cdmpyparser-3.1.0.tar.gz", "has_sig": false, "md5_digest": "bd89881ae0f30e40922ce170b4e144e8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 42893, "upload_time": "2019-04-25T23:24:34", "url": "https://files.pythonhosted.org/packages/34/18/b610d76cccb3a824ce65f28b80b0a197b617f7307d10f12d8d8078924c89/cdmpyparser-3.1.0.tar.gz" } ], "3.1.1": [ { "comment_text": "", "digests": { "md5": "62604087f9e19433b7c0ef9b3db12f96", "sha256": "f0719186ca5eb745954c9c9fbd6cfa22e73627779a831b6339f575089430568f" }, "downloads": -1, "filename": "cdmpyparser-3.1.1.tar.gz", "has_sig": false, "md5_digest": "62604087f9e19433b7c0ef9b3db12f96", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 42948, "upload_time": "2019-07-30T01:32:43", "url": "https://files.pythonhosted.org/packages/b9/78/7d0bdc6d1e87551d78523a0746aa25f770a93a1024f7832423c5ac9a791c/cdmpyparser-3.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "62604087f9e19433b7c0ef9b3db12f96", "sha256": "f0719186ca5eb745954c9c9fbd6cfa22e73627779a831b6339f575089430568f" }, "downloads": -1, "filename": "cdmpyparser-3.1.1.tar.gz", "has_sig": false, "md5_digest": "62604087f9e19433b7c0ef9b3db12f96", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 42948, "upload_time": "2019-07-30T01:32:43", "url": "https://files.pythonhosted.org/packages/b9/78/7d0bdc6d1e87551d78523a0746aa25f770a93a1024f7832423c5ac9a791c/cdmpyparser-3.1.1.tar.gz" } ] }