{"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":"python","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,"search_vec":"'0.0.14':49 '2025':53 'addit':17 'address':13 'appear':38 'bug':14 'cadenc':44 'design':11 'docstr':1,9,28,54 'document':56 'epydoc':34,60 'fork':3,7 'format':35 'function':18 'googl':31,58 'introduc':16 'irregular':42 'latest':47 'librari':24 'numpydoc':32,59 'pars':27 'parser':2,10,55 'present':20 'project':37 'publish':50 'releas':43 'restructuredtext':30,57 'septemb':52 'support':26 'upstream':23 'version':48","created_at":"2026-04-12T16:47:03.347752+00:00","updated_at":"2026-04-16T14:39:52.381628+00:00","problems":[{"fix":"Ensure only one of the two libraries (`docstring_parser` or `docstring-parser-fork`) is installed in your environment by uninstalling the unwanted version (e.g., `pip uninstall docstring_parser` or `pip uninstall docstring-parser-fork`).","cause":"Both the original `docstring_parser` library and `docstring-parser-fork` are installed in the same environment, and Python's import resolution order leads to the original library being loaded, which lacks fork-specific features like 'DocstringAttr'.","error":"ImportError: cannot import name 'DocstringAttr' from 'docstring_parser.common'"},{"fix":"The correct import statement is `from docstring_parser import parse` (or other components like `DocstringStyle`).","cause":"The user is attempting to import the library using its installation package name (`docstring_parser_fork`) rather than its actual internal module name (`docstring_parser`).","error":"ModuleNotFoundError: No module named 'docstring_parser_fork'"},{"fix":"Review the docstring format to ensure it conforms to the supported styles. For attribute docstrings in `__init__` methods, consider moving them to class or module level, or using direct `__doc__` attributes.","cause":"The docstring being parsed does not strictly adhere to one of the supported formats (reStructuredText, Google, Numpydoc, Epydoc), or attempts to parse unsupported constructs like attribute docstrings defined within `__init__` methods.","error":"docstring parsing throws errors at runtime for misformatted docstrings"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.0.16","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/rr-/docstring_parser","docs":null,"changelog":"https://github.com/rr-/docstring_parser/blob/master/CHANGELOG.md","pypi":"https://pypi.org/project/docstring-parser-fork/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-30","next_check":"2026-07-28","install_tag":null}}