{"id":24320,"library":"pydoctest","title":"pydoctest","description":"pydoctest is a tool to validate that Python docstrings (reStructuredText, Google, or NumPy style) match the actual function and method signatures. It checks type annotations in docstrings against the real types, flagging mismatches. Current version 0.2.1, supports Python >=3.6, and is in active maintenance mode with periodic updates.","status":"active","version":"0.2.1","language":"python","source_language":"en","source_url":"https://github.com/jepperaskdk/pydoctest","tags":["testing","docstrings","validation","types"],"install":[{"cmd":"pip install pydoctest","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"pydoctest is the top-level module, not a submodule.","wrong":"from pydoctest import pydoctest","symbol":"pydoctest","correct":"import pydoctest"}],"quickstart":{"code":"import pydoctest\n\n# Run on current directory recursively\nresult = pydoctest.run()\nprint(result)\n# Or run on specific file\nresult = pydoctest.run(include_paths=['example.py'])\nprint(result)","lang":"python","description":"Basic usage: call pydoctest.run() to validate all Python files in cwd, or specify paths."},"warnings":[{"fix":"Use one of the supported styles; check documentation for style detection.","message":"Supports only reStructuredText, Google, and NumPy styles. Other docstring formats will be ignored or cause false negatives.","severity":"gotcha","affected_versions":"all"},{"fix":"Update docstrings to use Optional[X] explicitly instead of '(optional)' marker.","message":"Version 0.1.18 removed support for the '(..., optional)' syntax in Google-style docstrings. Now you must use Optional[X] in both signature and docstring.","severity":"breaking","affected_versions":">=0.1.18"},{"fix":"Use exclude_paths instead of exclude in function calls and CLI.","message":"The 'exclude' parameter in run() is deprecated in favor of 'exclude_paths' since 0.1.17.","severity":"deprecated","affected_versions":">=0.1.17"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Ensure docstrings are in reStructuredText, Google, or NumPy style. If custom, provide a custom parser.","cause":"The file has a docstring style that pydoctest does not recognize.","error":"pydoctest.exceptions.ValidationError: No parser found for file"},{"fix":"Verify that include_paths point to existing Python files with .py extension.","cause":"Occurs when run() is called with no files matching the include_paths pattern.","error":"TypeError: 'NoneType' object is not iterable"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}