{ "info": { "author": "Jean-Ralph Aviles", "author_email": "jeanralph.aviles+pypi@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Topic :: Software Development :: Documentation" ], "description": "# Comment Parser\n\n[![Build Status](https://travis-ci.org/jeanralphaviles/comment_parser.svg?branch=master)](https://travis-ci.org/jeanralphaviles/comment_parser/branches)\n[![PyPI status](https://img.shields.io/pypi/status/comment_parser.svg)](https://pypi.python.org/pypi/comment_parser/)\n[![PyPI version shields.io](https://img.shields.io/pypi/v/comment_parser.svg)](https://pypi.python.org/pypi/comment_parser/)\n[![PyPI license](https://img.shields.io/pypi/l/comment_parser.svg)](https://pypi.python.org/pypi/comment_parser/)\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/comment_parser.svg)](https://pypi.python.org/pypi/comment_parser/)\n\nPython module used to extract comments from source code files of various types.\n\n## Installation\n\n### Prerequisites\n\n* libmagic\n\n### Linux/Unix\n\n```shell\nsudo pip3 install comment_parser\n```\n\n### OSX and Windows\nAdditionally, complete the special installation requirements for\n[python-magic](https://github.com/ahupp/python-magic).\n\n## Usage\n\nTo use, simply run:\n\n```python\n>>> from comment_parser import comment_parser\n>>> # Returns a list of comment_parser.parsers.common.Comments\n>>> comment_parser.extract_comments('/path/to/source_file')\n>>> # Or\n>>> comment_parser.extract_comments_from_str('...')\n```\n### extract_comments signatures\n\n```python\ndef extract_comments(filename, mime=None):\n \"\"\"Extracts and returns the comments from the given source file.\n\n Args:\n filename: String name of the file to extract comments from.\n mime: Optional MIME type for file (str). Note some MIME types accepted\n don't comply with RFC2045. If not given, an attempt to deduce the\n MIME type will occur.\n Returns:\n Python list of parsers.common.Comment in the order that they appear in\n the source file.\n Raises:\n UnsupportedError: If filename is of an unsupported MIME type.\n \"\"\"\n pass\n\n\ndef extract_comments_from_str(code, mime=None):\n \"\"\"Extracts and returns comments from the given source string.\n\n Args:\n code: String containing code to extract comments from.\n mime: Optional MIME type for code (str). Note some MIME types accepted\n don't comply with RFC2045. If not given, an attempt to deduce the\n MIME type will occur.\n Returns:\n Python list of parsers.common.Comment in the order that they appear in\n the source code.\n Raises:\n UnsupportedError: If code is of an unsupported MIME type.\n \"\"\"\n pass\n```\n### Comments Interface\n\n```python\nclass Comment(object):\n \"\"\"Represents comments found in source files.\"\"\"\n def text(self):\n \"\"\"Returns the comment's text.\n Returns:\n String\n \"\"\"\n pass\n\n def line_number(self):\n \"\"\"Returns the line number the comment was found on.\n Returns:\n Int\n \"\"\"\n pass\n\n def is_multiline(self):\n \"\"\"Returns whether this comment was a multiline comment.\n Returns:\n True if comment was a multiline comment, False if not.\n \"\"\"\n pass\n\n def __str__(self):\n pass\n\n def __eq__(self, other):\n pass\n```\n\n## Development\n\n### Running locally\n\nStart python3 in the base of repository.\n\n```python\nfrom comment_parser import comment_parser\ncomment_parser.extract_comments('foo.c', mime='text/x-c')\n```\n\n### Running tests\n\n```shell\npython3 setup.py test\n```\n\n### Running pylint\n\n```shell\npylint comment_parser\n```\n\n### Running formatter\n\n```shell\nyapf -rip --style=chromium .\n```\n\n### Deploying to PyPi\n\n```shell\npython3 setup.py sdist\ntwine upload dist/*\n```\n\n## Supported Programming Languages\n\n| Language | Mime String |\n|------------ |------------------------- |\n| C | text/x-c |\n| C++/C# | text/x-c++ |\n| Go | text/x-go |\n| HTML | text/html |\n| Java | text/x-java-source |\n| Javascript | application/javascript |\n| Python | text/x-python |\n| Ruby | text/x-ruby |\n| Shell | text/x-shellscript |\n| XML | text/xml |\n\nAnd more to come!\n\n*Check comment_parser.py for corresponding MIME types.*", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/jeanralphaviles/comment_parser", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "comment-parser", "package_url": "https://pypi.org/project/comment-parser/", "platform": "", "project_url": "https://pypi.org/project/comment-parser/", "project_urls": { "Homepage": "http://github.com/jeanralphaviles/comment_parser" }, "release_url": "https://pypi.org/project/comment-parser/1.1.6/", "requires_dist": null, "requires_python": "", "summary": "Parse comments from various source files.", "version": "1.1.6" }, "last_serial": 5900198, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "3bbc20da896e040868efc34712c2dd60", "sha256": "8bf6083d3647cf9d4f6af57a80600ce061821c6f698da6d94e7b424a9d100f90" }, "downloads": -1, "filename": "comment_parser-1.0.tar.gz", "has_sig": false, "md5_digest": "3bbc20da896e040868efc34712c2dd60", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3845, "upload_time": "2015-08-31T00:29:34", "url": "https://files.pythonhosted.org/packages/6a/b1/8086a0c291b2157cc92dd8d27a63505584b3e634a73dcfd32a5ffd9ab4d5/comment_parser-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "141422e5ddba0ddb38011967cb4e1b95", "sha256": "0c41e67b8d3874e287a3369435388e5157cd266d59ea924f9b3b18613242aa26" }, "downloads": -1, "filename": "comment_parser-1.0.1.tar.gz", "has_sig": false, "md5_digest": "141422e5ddba0ddb38011967cb4e1b95", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4288, "upload_time": "2015-08-31T01:42:24", "url": "https://files.pythonhosted.org/packages/63/46/2098b920eab1269d7f526c608394f72f1db0aa48d800f69e3c3e8de5d2e0/comment_parser-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "96abf66b8eb3fd5a2948d99e399e9c14", "sha256": "a35d6f63eba74b26a0a7781099008db8b70f3704fabce55acadddca42f24d9ff" }, "downloads": -1, "filename": "comment_parser-1.0.2.tar.gz", "has_sig": false, "md5_digest": "96abf66b8eb3fd5a2948d99e399e9c14", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4455, "upload_time": "2015-09-05T01:24:26", "url": "https://files.pythonhosted.org/packages/77/a0/ccf697cce10d362b2f5565e01afac8a0fc1f5305bb036ef3c06654cf0525/comment_parser-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "583e73b217c89fcfef4a6ca9c0eeaa8a", "sha256": "a14f186dcee232507de4707f85c59dcaa2ef39b20fe0df56349e2c225d048491" }, "downloads": -1, "filename": "comment_parser-1.0.3.tar.gz", "has_sig": false, "md5_digest": "583e73b217c89fcfef4a6ca9c0eeaa8a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4792, "upload_time": "2015-09-06T19:10:35", "url": "https://files.pythonhosted.org/packages/23/4c/175d8a7f8757fb0c2b254d4549079dbb118c92a63f7daf9453e14bc8d2da/comment_parser-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "ddf7c18ec07b504f9b0032e2a26dcbfd", "sha256": "48d7e2c22c8ebff140e7f8e26de4e01dd651cb9cdd4b3076ecc8ec8aaa1361b2" }, "downloads": -1, "filename": "comment_parser-1.0.4.tar.gz", "has_sig": false, "md5_digest": "ddf7c18ec07b504f9b0032e2a26dcbfd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5378, "upload_time": "2018-11-03T17:17:42", "url": "https://files.pythonhosted.org/packages/54/26/7a1ea0167906d30ed3e4601d8f0520e6bd8300f295014d3b5d36c37c709b/comment_parser-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "26a19846ff378fdda1b1b9cb73840e42", "sha256": "3acedaa589bce6e2ab026a2a56de55db7802f8e247f4907fff83b90a5e132952" }, "downloads": -1, "filename": "comment_parser-1.0.5.tar.gz", "has_sig": false, "md5_digest": "26a19846ff378fdda1b1b9cb73840e42", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5645, "upload_time": "2018-11-03T17:34:15", "url": "https://files.pythonhosted.org/packages/8e/60/b15d224546075328809987698a733445f84a11c7737b75d4d3ff6f455ff8/comment_parser-1.0.5.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "d0a00d6a9b92405409fdbc6fdd963005", "sha256": "4daebf0820e375462125c1e584ebbfe27fcf440c3bd6f81b0eec30ba291f596c" }, "downloads": -1, "filename": "comment_parser-1.0.6.tar.gz", "has_sig": false, "md5_digest": "d0a00d6a9b92405409fdbc6fdd963005", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5727, "upload_time": "2018-11-03T17:48:18", "url": "https://files.pythonhosted.org/packages/78/9d/bc5946068eb416dd2ef8d5cf724b9a93854c6aecafbc42ff7ed052f39737/comment_parser-1.0.6.tar.gz" } ], "1.0.7": [ { "comment_text": "", "digests": { "md5": "d7a144e93811d431c779e463bea14413", "sha256": "153871390ad5d7093b7a83077c6548afc84027e0bcafdc0b6cb005c09fcf98f7" }, "downloads": -1, "filename": "comment_parser-1.0.7.tar.gz", "has_sig": false, "md5_digest": "d7a144e93811d431c779e463bea14413", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5956, "upload_time": "2018-11-03T22:48:58", "url": "https://files.pythonhosted.org/packages/8a/1a/da14653906a0547903313bad95f31c39c6c41f9a99f5370675d78c86a143/comment_parser-1.0.7.tar.gz" } ], "1.0.8": [ { "comment_text": "", "digests": { "md5": "762893c6404f61193fdd9a5a78f2e7bd", "sha256": "930e3ca8bb73882ff788609d00e5960cacaaaadf8e006760b29a40c07ac866e0" }, "downloads": -1, "filename": "comment_parser-1.0.8.tar.gz", "has_sig": false, "md5_digest": "762893c6404f61193fdd9a5a78f2e7bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5967, "upload_time": "2018-11-07T16:29:06", "url": "https://files.pythonhosted.org/packages/54/62/6a5ce783d83be3576c5c7592bfde5968dc7317187e5630c3c7d86bcb2807/comment_parser-1.0.8.tar.gz" } ], "1.0.9": [ { "comment_text": "", "digests": { "md5": "9d2c36d29fc20a1ee26571dfb1f8d121", "sha256": "c800f09fad072d8be2dbfa862c11045931adedbf9775738c6c424cff45a70dd6" }, "downloads": -1, "filename": "comment_parser-1.0.9-py3.7.egg", "has_sig": false, "md5_digest": "9d2c36d29fc20a1ee26571dfb1f8d121", "packagetype": "bdist_egg", "python_version": "3.7", "requires_python": null, "size": 21224, "upload_time": "2019-08-04T06:08:44", "url": "https://files.pythonhosted.org/packages/7d/fe/799e484e20887c33d2c46a6da90d8279eb0077d9a4bf44215e5ef5ce8034/comment_parser-1.0.9-py3.7.egg" }, { "comment_text": "", "digests": { "md5": "aa430b9473048ac84dd018576ba0b51c", "sha256": "c6c8de788b3aa5a8d7d53992a0b02dd105a562bf4e0cdd2be24affa69ebbaf8d" }, "downloads": -1, "filename": "comment_parser-1.0.9.tar.gz", "has_sig": false, "md5_digest": "aa430b9473048ac84dd018576ba0b51c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5926, "upload_time": "2019-06-01T03:46:35", "url": "https://files.pythonhosted.org/packages/c1/d1/325caee192abed55a09a38ce1870bc7e194183884766470e8de3c4154370/comment_parser-1.0.9.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "287f87355e072a0bb4cfd8cbf3b613e8", "sha256": "5d4048d4ad263f812f0bd14ee1ab6b0ce9c0b64c7d8227fe4cb31931acdaf191" }, "downloads": -1, "filename": "comment_parser-1.1.0.tar.gz", "has_sig": false, "md5_digest": "287f87355e072a0bb4cfd8cbf3b613e8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6738, "upload_time": "2019-08-04T06:08:46", "url": "https://files.pythonhosted.org/packages/9c/96/0dccb78e2ea0f33542511a306d3053d8ddd75c82fa0b52523d8bedecf31a/comment_parser-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "5c653dd617d2e51839e0ce10742b0349", "sha256": "da7c364f6e07b21f6fb9287a2408f1f956090d1951e016d235c75c574f5d76a1" }, "downloads": -1, "filename": "comment_parser-1.1.1.tar.gz", "has_sig": false, "md5_digest": "5c653dd617d2e51839e0ce10742b0349", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6756, "upload_time": "2019-08-04T07:07:05", "url": "https://files.pythonhosted.org/packages/34/f6/6582c235aa990d1d2696f011a25ec8a3074649d3ced5f4fa1bcf4070cd0c/comment_parser-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "fbcce5373f140f9841a487d3cfbdae3f", "sha256": "5f486ef2508a1ac805c9073382ce0d863e107af77f98cbdd100bc4b3a2378134" }, "downloads": -1, "filename": "comment_parser-1.1.2.tar.gz", "has_sig": false, "md5_digest": "fbcce5373f140f9841a487d3cfbdae3f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6759, "upload_time": "2019-08-04T07:21:20", "url": "https://files.pythonhosted.org/packages/0e/55/b20cbe9a0f959f90a23b38742da1b6dea5dbb5ff4895f6fc8d4875a80ef7/comment_parser-1.1.2.tar.gz" } ], "1.1.3": [ { "comment_text": "", "digests": { "md5": "969e55ff3bb15fa072c0f9d78f17ef84", "sha256": "5c1d1582daf4783a3b2f7848b84f7e2b22a9d49a9098a5d21115c023d4efb682" }, "downloads": -1, "filename": "comment_parser-1.1.3.tar.gz", "has_sig": false, "md5_digest": "969e55ff3bb15fa072c0f9d78f17ef84", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7270, "upload_time": "2019-08-27T05:38:00", "url": "https://files.pythonhosted.org/packages/fd/18/d982206a31171ae9807a289a85d9b289fa81e8f786d7561668ca6cd6b11b/comment_parser-1.1.3.tar.gz" } ], "1.1.4": [ { "comment_text": "", "digests": { "md5": "d954c3b6cd2f7df78d7f683114e0e727", "sha256": "755edf614a252b3b34462b67c9a82a80ead4426efa66ee703c724fa80c4218a5" }, "downloads": -1, "filename": "comment_parser-1.1.4.tar.gz", "has_sig": false, "md5_digest": "d954c3b6cd2f7df78d7f683114e0e727", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7346, "upload_time": "2019-08-28T04:30:26", "url": "https://files.pythonhosted.org/packages/52/0d/362079c6f7e2431ee58392de8d40524d1edb92d742eae6ba4e544f623a08/comment_parser-1.1.4.tar.gz" } ], "1.1.5": [ { "comment_text": "", "digests": { "md5": "5c6225cd0ea3f8cef2135c439222ddde", "sha256": "1c6539988b0d3b85035f8ac7d522c56893c4b15669e8f33e9ee6cce3bd45529b" }, "downloads": -1, "filename": "comment_parser-1.1.5.tar.gz", "has_sig": false, "md5_digest": "5c6225cd0ea3f8cef2135c439222ddde", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7651, "upload_time": "2019-09-28T06:07:30", "url": "https://files.pythonhosted.org/packages/af/2e/b84d038d95889e6886dc973256a2a6415bddfc10a5401b83e4ceba67f03d/comment_parser-1.1.5.tar.gz" } ], "1.1.6": [ { "comment_text": "", "digests": { "md5": "76e967ff4d900221e9b939d674d5657d", "sha256": "edb01b82427956acc21cbbf95c51a83bd7e76d7e52feb879a18e24560b52fa17" }, "downloads": -1, "filename": "comment_parser-1.1.6.tar.gz", "has_sig": false, "md5_digest": "76e967ff4d900221e9b939d674d5657d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7677, "upload_time": "2019-09-28T17:50:14", "url": "https://files.pythonhosted.org/packages/e4/d8/68573e94b1b32ced6cfd7b90b7e70e72180d526f96d571d80a1e5c86b53c/comment_parser-1.1.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "76e967ff4d900221e9b939d674d5657d", "sha256": "edb01b82427956acc21cbbf95c51a83bd7e76d7e52feb879a18e24560b52fa17" }, "downloads": -1, "filename": "comment_parser-1.1.6.tar.gz", "has_sig": false, "md5_digest": "76e967ff4d900221e9b939d674d5657d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7677, "upload_time": "2019-09-28T17:50:14", "url": "https://files.pythonhosted.org/packages/e4/d8/68573e94b1b32ced6cfd7b90b7e70e72180d526f96d571d80a1e5c86b53c/comment_parser-1.1.6.tar.gz" } ] }