Skip to content

API Reference

This is a crucial part of a Python project's documentation. It should be auto-generated from your docstrings.

Tool

Use a plugin like mkdocstrings-python with griffe. This reads your docstrings and creates a full, searchable API reference.

Structure

The API reference should be organized by module, class, and function. Each entry should include the function signature, parameters, and a description.

::: jm_python_template
options:
show_submodules: true

jm_python_template

Modules

app

Functions
docs
docs(name: str = typer.Option(..., help='The name of the project')) -> None

Generate docs for a project.

hello
hello(name: Annotated[str, Argument(..., help='The name of the person to greet')], color: Annotated[str | None, Option(--color, help='The color of the output')] = None) -> None

Some docstring content.

main

Functions
comma
comma(name: Annotated[str, Option()] = 'World', _version: Annotated[bool | None, Option(--version, callback=version_callback)] = None) -> None

Main function of the application.

Parameters:

Name Type Description Default
name str

The name to greet.

'World'
version Optional[bool]

Whether to print the version.

required

Returns:

Type Description
None

None

version_callback
version_callback(*, value: bool) -> None

Print the version and exit.

Parameters:

Name Type Description Default
value bool

Whether to print the version.

required

Returns:

Type Description
None

None

options: show_submodules: true