Skip to main content

sphinxcontrib-typer

License: MIT PyPI version PyPI pyversions PyPI status Documentation Status Code Cov Test Status Lint Status Ruff OpenSSF Scorecard

A Sphinx directive for auto generating docs for Typer applications using the rich console formatting available in Typer. This package generates concise command documentation in text, html or svg formats out of the box. If you need to document a standalone Click command, or want to greatly customize the generated documentation, sphinx-click may be more appropriate and will also work for Typer commands.

Installation

Install with pip::

pip install sphinxcontrib-typer

Add sphinxcontrib.typer to your conf.py file:

# be sure that the commands you want to document are importable
# from the python path when building the docs
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent / '../path/to/your/commands'))

extensions = [
    ...
    'sphinxcontrib.typer',
    ...
]

Usage

Say you have a command in the file examples/example.py that looks like this:

import typer
import typing as t

app = typer.Typer(add_completion=False)


@app.callback()
def callback(
    flag1: bool = typer.Option(False, help="Flag 1."),
    flag2: bool = typer.Option(False, help="Flag 2."),
):
    """This is the callback function."""
    pass


@app.command()
def foo(name: str = typer.Option(..., help="The name of the item to foo.")):
    """This is the foo command."""
    pass


@app.command()
def bar(
    names: t.List[str] = typer.Option(..., help="The names of the items to bar."),
):
    """This is the bar command."""
    pass


if __name__ == "__main__":
    app()

You can generate documentation for this command using the typer directive like so:

.. typer:: examples.example.app
    :prog: example1
    :width: 70
    :preferred: html

This would generate html that looks like this:

Example PNG

You could change :preferred: to svg, to generate svg instead:

Example SVG

|

Or to text

Usage: example [OPTIONS] COMMAND [ARGS]...                                                  
                                                                                            
This is the callback function.                                                              
                                                                                            
╭─ Options ──────────────────────────────────────────────────────────╮
│ --flag1    --no-flag1      Flag 1. [default: no-flag1]             │
│ --flag2    --no-flag2      Flag 2. [default: no-flag2]             │
│ --help                     Show this message and exit.             │
╰────────────────────────────────────────────────────────────────────╯
╭─ Commands ─────────────────────────────────────────────────────────╮
│ bar           This is the bar command.                             │
│ foo           This is the foo command.                             │
╰────────────────────────────────────────────────────────────────────╯

The typer directive has options for generating docs for all subcommands as well and optionally generating independent sections for each. There are also mechanisms for passing options to the underlying console and svg generation functions. See the official documentation for more information.

Metadata

Release files for sphinxcontrib-typer 0.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinxcontrib-typer 0.10.0
File Size Uploaded
sphinxcontrib_typer-0.10.0.tar.gz 179.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinxcontrib-typer 0.10.0
File Interpreter ABI Platform
sphinxcontrib_typer-0.10.0-py3-none-any.whl Python 3 none any Details

Total release size: 195.1 kB

Release files / sphinxcontrib_typer-0.10.0.tar.gz

Download URL sphinxcontrib_typer-0.10.0.tar.gz
Size 179.0 kB
Tags Source
SHA-256 checksum
How to use checksums
601e778a480a21ea04cbc9ec85f3ee97ad5f3b204e7d45b688859eb85aa86f00
BLAKE2b-256 checksum
How to use checksums
18f044808e02ccd166c7fb14403a0dec45377cf7a0ecce461950187fb079fa16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.

Transparency log

Release files / sphinxcontrib_typer-0.10.0-py3-none-any.whl

Download URL sphinxcontrib_typer-0.10.0-py3-none-any.whl
Size 16.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4fe962cc45afe62579428b9327e2a7187ed70176337ac2e35a9a86345e4ab62
BLAKE2b-256 checksum
How to use checksums
65c0aa30a8f8dc9b2aab8108282d9369b65ee6b781a6d3560a50e4bb1c6327eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.10.0 This release

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page