# Python Autodoc

**autodoc-py** turns a Python package into Dockit API reference pages. It reads source files with Python's abstract syntax tree, then writes MDX pages with navigation metadata, signatures, docstrings, and links to source.

Your package does not run during generation. You can document a release without installing its application dependencies or triggering startup code.

## From source to reference

```bash
python -m pip install dreamlake-autodoc-py==0.2.0a1

autodoc-py src/my_package \
  --module my_package \
  --output docs/pages/api \
  --section 'Python API'
```

Dockit discovers the generated `+Page.mdx` files through its existing page glob. They participate in the sidebar, search, table of contents, and Markdown exports alongside your hand-written guides.

- [Generate API docs](/python-autodoc/usage.md): installation, CLI options, routes, and source links.
- [Build integration](/python-autodoc/usage.md#dockit-integration): run generation before a build and keep version branches reproducible.
- [Python API display](/python-autodoc/display.md): typed classes, properties, aliases, and async methods.
- [Release notes](/python-autodoc/release-notes.md): source versions, compatibility, and distribution status.
- [Source repository](https://github.com/dreamlake-ai/autodoc-py): implementation, tests, and contributions.

## What it documents

| Python source | Generated reference |
| --- | --- |
| Modules | Module docstrings, grouped topic pages, or a page per public module |
| Classes and functions | Signatures, docstrings, and source links |
| Class members | Constructors, methods, annotated attributes, and assigned attributes |
| Local imports | Linked indexes for explicit and star re-exports |
| Local base classes | Inherited member lists, with overridden names suppressed |
| Literal `__all__` | Filtering of locally defined public classes and functions |

Private modules and tests are skipped. A generated-file manifest records the pages the tool owns, so removing a Python module removes its generated page without deleting unrelated hand-written pages.

## Generator version

The badge identifies the released generator version pinned by this workspace. The first PyPI prerelease is `0.2.0a1`; a release selector will follow when multiple documentation builds are available. The generator source revision and the version of the Python package being documented are independent.

## Static analysis boundaries

The generator documents declarations in source. It does not resolve dynamically created members, runtime signatures, external-package inheritance or re-exports, or module-qualified base expressions. Local inheritance follows base declaration order; it does not implement Python's complete C3 method resolution order.

Docstrings retain their content, but Sphinx roles and directives are not executed. Keep earlier Sphinx builds if exact historical rendering matters. Use a Python interpreter that can parse the syntax in the release you are documenting; the generator itself requires Python 3.10 or later.
