skillfed

pytkdocs

Load Python objects documentation.

pytkdocs v0.16.5 170.4K downloads/30d#10,397 on PyPI54
Permissive license ISC AGING released

What it is and what it does

pytkdocs is a command-line tool that introspects Python source code and outputs structured documentation as JSON. It reads a JSON request describing which Python objects to document (modules, classes, functions, etc.), then loads those objects, parses their docstrings in Google, NumPy, or reStructuredText format, and returns a JSON response with the extracted metadata, docstring sections, source locations, and object hierarchies. It supports filtering by name patterns, selecting inherited members, and configurable docstring parsing options.

The tool is designed to be used as a subprocess by other programs—notably mkdocstrings—feeding it single lines of JSON and reading back single lines of JSON in line-by-line mode. However, the project is now deprecated in favor of Griffe, a more powerful alternative. If you are starting a new documentation pipeline, Griffe is recommended; pytkdocs remains functional for existing integrations but is no longer actively developed.

Use it for:

  • Feed Python module paths to pytkdocs as JSON to extract docstrings and signatures for auto-generated API documentation.
  • Integrate pytkdocs into mkdocstrings or similar documentation generators to parse Python source without importing it.
  • Filter and select specific members of a module (e.g., public API only) and output structured metadata for custom doc tools.
  • Parse and normalize docstrings across multiple styles (Google, NumPy, reStructuredText) into a common JSON format.
  • Analyze Python code structure (classes, methods, attributes) and their documentation in a subprocess without loading the module directly.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Extracts and serializes Python object documentation (modules, classes, functions, attributes) from source code, accepting JSON input describing what to document and outputting structured JSON with parsed docstrings and metadata.

Yes, if you are maintaining an existing tool or workflow that already depends on pytkdocs. No, if you are starting a new documentation project—the maintainers explicitly recommend Griffe as a more powerful alternative. The tool is stable and has no known vulnerabilities, but its aging maintenance status (last release 523 days ago) and deprecation notice mean it should not be the first choice for new integrations.

Install

pytkdocs on PyPI

pip

pip install pytkdocs

uv

uv add pytkdocs

poetry

poetry add pytkdocs

Installing pytkdocs

Before you install

Low friction install with three lightweight runtime dependencies. Maintenance status is aging—last release was 523 days ago—and the project itself recommends Griffe as a more powerful alternative, so consider whether this tool still fits your documentation workflow.

License in practice

Licensed under ISC (permissive), allowing free use, modification, and distribution with minimal restrictions.

Quickstart

pip install pytkdocs

# Feed JSON on stdin describing what to document
echo '{"objects": [{"path": "mymodule", "members": true, "docstring_style": "google"}]}' | pytkdocs

Requires Python 3.9 or later; designed as a subprocess tool reading and writing JSON, not a library for direct import.

Verify before relying

  • Whether the aging maintenance status (last release 523 days ago) affects compatibility with recent Python versions despite classifier claims.
  • Real-world performance on large codebases or deeply nested object hierarchies.
  • Whether Griffe is a drop-in replacement or requires significant workflow changes.

Package facts

License ISC (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 3 — astunparse, cached-property, typing-extensions
Maintenance aging — 523 days since the last release
Last repo commit
First released
Downloads 170,393/month — #10,397 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pytkdocs-0.16.5-py3-none-any.whl

Keywords: python, source, signature, docs

Development Status :: 4 - BetaIntended Audience :: DevelopersProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: DocumentationTopic :: Software DevelopmentTopic :: UtilitiesTyping :: Typed

Tags

python documentation extractionparse python docstringsload python object metadatagenerate api documentationpython source introspectiondocstring parser jsonpython code analysis
docstring-parsingapi-documentationdeprecated

More Software Development packages