docstring-parser


Namedocstring-parser JSON
Version 0.17.0 PyPI version JSON
download
home_pageNone
SummaryParse Python docstrings in reST, Google and Numpydoc format
upload_time2025-07-21 07:35:01
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
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
git clone https://github.com/rr-/docstring_parser.git
cd docstring_parser

python -m venv venv  # create environment
source venv/bin/activate  # activate environment

pip install -e ".[dev]"  # install as editable
pre-commit install  # make sure pre-commit is setup
```

To run tests:
```
source venv/bin/activate
pytest
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "docstring-parser",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Marcin Kurczewski <dash@wind.garden>",
    "download_url": "https://files.pythonhosted.org/packages/b2/9d/c3b43da9515bd270df0f80548d9944e389870713cc1fe2b8fb35fe2bcefd/docstring_parser-0.17.0.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\ngit clone https://github.com/rr-/docstring_parser.git\ncd docstring_parser\n\npython -m venv venv  # create environment\nsource venv/bin/activate  # activate environment\n\npip install -e \".[dev]\"  # install as editable\npre-commit install  # make sure pre-commit is setup\n```\n\nTo run tests:\n```\nsource venv/bin/activate\npytest\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Parse Python docstrings in reST, Google and Numpydoc format",
    "version": "0.17.0",
    "project_urls": {
        "changelog": "https://github.com/rr-/docstring_parser/blob/master/CHANGELOG.md",
        "homepage": "https://github.com/rr-/docstring_parser",
        "repository": "https://github.com/rr-/docstring_parser"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "55e22537ebcff11c1ee1ff17d8d0b6f4db75873e3b0fb32c2d4a2ee31ecb310a",
                "md5": "95db69ffa617b9a59ea724a6b32c5b99",
                "sha256": "cf2569abd23dce8099b300f9b4fa8191e9582dda731fd533daf54c4551658708"
            },
            "downloads": -1,
            "filename": "docstring_parser-0.17.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "95db69ffa617b9a59ea724a6b32c5b99",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 36896,
            "upload_time": "2025-07-21T07:35:00",
            "upload_time_iso_8601": "2025-07-21T07:35:00.684056Z",
            "url": "https://files.pythonhosted.org/packages/55/e2/2537ebcff11c1ee1ff17d8d0b6f4db75873e3b0fb32c2d4a2ee31ecb310a/docstring_parser-0.17.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b29dc3b43da9515bd270df0f80548d9944e389870713cc1fe2b8fb35fe2bcefd",
                "md5": "0bc69a706b2887320339acc395ee0a61",
                "sha256": "583de4a309722b3315439bb31d64ba3eebada841f2e2cee23b99df001434c912"
            },
            "downloads": -1,
            "filename": "docstring_parser-0.17.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0bc69a706b2887320339acc395ee0a61",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 27442,
            "upload_time": "2025-07-21T07:35:01",
            "upload_time_iso_8601": "2025-07-21T07:35:01.868877Z",
            "url": "https://files.pythonhosted.org/packages/b2/9d/c3b43da9515bd270df0f80548d9944e389870713cc1fe2b8fb35fe2bcefd/docstring_parser-0.17.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-21 07:35:01",
    "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: 2.44330s