{"id":4936,"library":"docstring-parser-fork","title":"Docstring Parser Fork","description":"This is a fork of `docstring_parser`, designed to address bugs and introduce additional functionalities not present in the upstream library. It supports parsing docstrings in reStructuredText, Google, Numpydoc, and Epydoc formats. The project appears to have an irregular release cadence, with the latest version 0.0.14 published in September 2025.","status":"active","version":"0.0.14","language":"en","source_language":"en","source_url":"https://github.com/rr-/docstring_parser","tags":["docstring","parser","documentation","restructuredtext","google","numpydoc","epydoc"],"install":[{"cmd":"pip install docstring-parser-fork","lang":"bash","label":"PyPI"},{"cmd":"conda install -c conda-forge docstring_parser","lang":"bash","label":"Conda (note: package name is 'docstring_parser')"}],"dependencies":[],"imports":[{"note":"Despite the package name 'docstring-parser-fork', the import path remains 'docstring_parser' for compatibility with the upstream library.","wrong":"from docstring_parser_fork import parse","symbol":"parse","correct":"from docstring_parser import parse"},{"note":"Used to specify or infer docstring styles during parsing.","symbol":"DocstringStyle","correct":"from docstring_parser import DocstringStyle"}],"quickstart":{"code":"from docstring_parser import parse, DocstringStyle\n\ndef example_function(name: str, priority: int = 1) -> None:\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    :raises ValueError: if name is invalid\n    \"\"\"\n    pass\n\ndocstring = parse(example_function.__doc__, style=DocstringStyle.AUTO)\n\nprint(f\"Short description: {docstring.short_description}\")\nprint(f\"Long description: {docstring.long_description}\")\nfor param in docstring.params:\n    print(f\"Param: {param.arg_name}, Type: {param.type_name}, Description: {param.description}\")\nfor rais in docstring.raises:\n    print(f\"Raises: {rais.type_name}, Description: {rais.description}\")","lang":"python","description":"This example demonstrates how to parse a function's docstring using the `parse` function and access its components like short description, long description, parameters, and raised exceptions. The `DocstringStyle.AUTO` option attempts to automatically detect the docstring format."},"warnings":[{"fix":"Ensure only one of the two libraries (`docstring_parser` or `docstring-parser-fork`) is installed in your environment to avoid import collisions.","message":"This library is a fork of `docstring_parser` and shares the same import path (`from docstring_parser import ...`). If both the original `docstring_parser` and `docstring-parser-fork` are installed, unexpected behavior or conflicts may occur due to Python's import resolution order.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consult the `CHANGELOG.md` in the project repository for detailed differences and adjust code as necessary, especially for edge cases in docstring parsing that the fork may now handle differently or correctly.","message":"The fork explicitly fixes bugs and offers additional functionalities compared to the upstream `docstring_parser`. While intended as improvements, users migrating from the original library should review the `CHANGELOG.md` file for entries marked '(Fork)' to understand specific behavioral changes that might affect existing code relying on previous `docstring_parser` quirks or omissions.","severity":"breaking","affected_versions":"All versions when migrating from original `docstring_parser`"},{"fix":"For attribute docstrings in `__init__`, consider moving them to class or module level, or using direct `__doc__` attributes where possible. For inherited attributes, separate calls to `parse_from_object` for parent classes are required if their attribute docstrings are needed.","message":"When parsing attribute docstrings, the `parse_from_object` function currently only supports attributes defined at class and module levels. Attribute docstrings defined within `__init__` methods are not supported. Additionally, when given a class, only attribute docstrings of that specific class are parsed, not inherited ones.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}