docstring_parser


Namedocstring_parser JSON
Version 0.16 PyPI version JSON
download
home_pagehttps://github.com/rr-/docstring_parser
SummaryParse Python docstrings in reST, Google and Numpydoc format
upload_time2024-03-15 10:39:44
maintainer
docs_urlNone
authorMarcin Kurczewski
requires_python>=3.6,<4.0
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            docstring_parser
================

[![Build](https://github.com/rr-/docstring_parser/actions/workflows/build.yml/badge.svg)](https://github.com/rr-/docstring_parser/actions/workflows/build.yml)

Parse Python docstrings. Currently support ReST, Google, Numpydoc-style and
Epydoc docstrings.

Example usage:

```python
>>> from docstring_parser import parse
>>>
>>>
>>> docstring = parse(
...     '''
...     Short description
...
...     Long description spanning multiple lines
...     - First line
...     - Second line
...     - Third line
...
...     :param name: description 1
...     :param int priority: description 2
...     :param str sender: description 3
...     :raises ValueError: if name is invalid
...     ''')
>>>
>>> docstring.long_description
'Long description spanning multiple lines\n- First line\n- Second line\n- Third line'
>>> docstring.params[1].arg_name
'priority'
>>> docstring.raises[0].type_name
'ValueError'
```

Read [API Documentation](https://rr-.github.io/docstring_parser/).

# Installation

Installation using pip

```shell
pip install docstring_parser

# or if you want to install it in a virtual environment

python -m venv venv # create environment
source venv/bin/activate # activate environment
python -m pip install docstring_parser
```

Installation using conda


1. Download and install miniconda or anaconda
2. Install the package from the conda-forge channel via:
  - `conda install -c conda-forge docstring_parser`
  - or create a new conda environment via `conda create -n my-new-environment -c conda-forge docstring_parser`


# Contributing

To set up the project:
```sh
pip install --user poetry

git clone https://github.com/rr-/docstring_parser.git
cd docstring_parser

poetry install
poetry run pre-commit install
```

To run tests:
```
poetry run pytest
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/rr-/docstring_parser",
    "name": "docstring_parser",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Marcin Kurczewski",
    "author_email": "dash@wind.garden",
    "download_url": "https://files.pythonhosted.org/packages/08/12/9c22a58c0b1e29271051222d8906257616da84135af9ed167c9e28f85cb3/docstring_parser-0.16.tar.gz",
    "platform": null,
    "description": "docstring_parser\n================\n\n[![Build](https://github.com/rr-/docstring_parser/actions/workflows/build.yml/badge.svg)](https://github.com/rr-/docstring_parser/actions/workflows/build.yml)\n\nParse Python docstrings. Currently support ReST, Google, Numpydoc-style and\nEpydoc docstrings.\n\nExample usage:\n\n```python\n>>> from docstring_parser import parse\n>>>\n>>>\n>>> docstring = parse(\n...     '''\n...     Short description\n...\n...     Long description spanning multiple lines\n...     - First line\n...     - Second line\n...     - Third line\n...\n...     :param name: description 1\n...     :param int priority: description 2\n...     :param str sender: description 3\n...     :raises ValueError: if name is invalid\n...     ''')\n>>>\n>>> docstring.long_description\n'Long description spanning multiple lines\\n- First line\\n- Second line\\n- Third line'\n>>> docstring.params[1].arg_name\n'priority'\n>>> docstring.raises[0].type_name\n'ValueError'\n```\n\nRead [API Documentation](https://rr-.github.io/docstring_parser/).\n\n# Installation\n\nInstallation using pip\n\n```shell\npip install docstring_parser\n\n# or if you want to install it in a virtual environment\n\npython -m venv venv # create environment\nsource venv/bin/activate # activate environment\npython -m pip install docstring_parser\n```\n\nInstallation using conda\n\n\n1. Download and install miniconda or anaconda\n2. Install the package from the conda-forge channel via:\n  - `conda install -c conda-forge docstring_parser`\n  - or create a new conda environment via `conda create -n my-new-environment -c conda-forge docstring_parser`\n\n\n# Contributing\n\nTo set up the project:\n```sh\npip install --user poetry\n\ngit clone https://github.com/rr-/docstring_parser.git\ncd docstring_parser\n\npoetry install\npoetry run pre-commit install\n```\n\nTo run tests:\n```\npoetry run pytest\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Parse Python docstrings in reST, Google and Numpydoc format",
    "version": "0.16",
    "project_urls": {
        "Homepage": "https://github.com/rr-/docstring_parser",
        "Repository": "https://github.com/rr-/docstring_parser"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d57ce9fcff7623954d86bdc17782036cbf715ecab1bec4847c008557affe1ca8",
                "md5": "61ce5491596abd15c5ae50b8c11e66c3",
                "sha256": "bf0a1387354d3691d102edef7ec124f219ef639982d096e26e3b60aeffa90637"
            },
            "downloads": -1,
            "filename": "docstring_parser-0.16-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "61ce5491596abd15c5ae50b8c11e66c3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6,<4.0",
            "size": 36533,
            "upload_time": "2024-03-15T10:39:41",
            "upload_time_iso_8601": "2024-03-15T10:39:41.527363Z",
            "url": "https://files.pythonhosted.org/packages/d5/7c/e9fcff7623954d86bdc17782036cbf715ecab1bec4847c008557affe1ca8/docstring_parser-0.16-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "08129c22a58c0b1e29271051222d8906257616da84135af9ed167c9e28f85cb3",
                "md5": "45edfdd2102d8b763a7343228c59295e",
                "sha256": "538beabd0af1e2db0146b6bd3caa526c35a34d61af9fd2887f3a8a27a739aa6e"
            },
            "downloads": -1,
            "filename": "docstring_parser-0.16.tar.gz",
            "has_sig": false,
            "md5_digest": "45edfdd2102d8b763a7343228c59295e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6,<4.0",
            "size": 26565,
            "upload_time": "2024-03-15T10:39:44",
            "upload_time_iso_8601": "2024-03-15T10:39:44.419478Z",
            "url": "https://files.pythonhosted.org/packages/08/12/9c22a58c0b1e29271051222d8906257616da84135af9ed167c9e28f85cb3/docstring_parser-0.16.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-15 10:39:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rr-",
    "github_project": "docstring_parser",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "docstring_parser"
}
        
Elapsed time: 0.22639s