Skip to main content

pydantic-kitbash

Kitbash is a Sphinx extension that generates reference documentation for Pydantic models.

Kitbash parses a model to describe its fields in a Sphinx document. It can target an entire model or specific fields. When covering a specific field, you can add reStructuredText to the field's docstring to supplement the standard output.

Basic usage

The kitbash-field directive documents an individual field:

.. kitbash-field:: my_model my_field

The kitbash-model directive directive documents an entire model:

.. kitbash-model:: my_model

Options

skip-examples

Bypasses the field's examples on the page. Use this when the examples are incomplete or unhelpful.

.. kitbash-field:: my_model my_field
    :skip-examples:

override-description

Replaces the field's description with the directive content instead of appending to it. Use this to modify field descriptions inherited from libraries.

.. kitbash-field:: upstream_model my_field
    :override-description:

    This text replaces the field's description.

override-type

Overrides the field's type on the page. Use this when the type is overly verbose, malformed, or unhelpful.

.. kitbash-field:: my_model my_field
    :override-type: Any

prepend-name

Adds a prefix to the field name on the page. The prefix is separated by a period (.). This example makes the field render as permissions.my_field:

.. kitbash-field:: my_model my_field
    :prepend-name: permissions

append-name

Adds a suffix to the field name on the page. The suffix is separated by a period (.). This example makes the field render as my_field.v1:

.. kitbash-field:: my_model my_field
    :append-name: v1

label

Overrides the reStructuredText label for a field. By default, Kitbash adds a label for each entry, formatted as <page-filename>-<field-name>. This example renames the label to dev-my-field:

.. kitbash-field:: my_model my_field
    :label: dev-my-field

Directive content

By default, directive content is appended to the description. Use this to provide additional context or information on fields sourced from libraries.

.. kitbash-field:: my_model my_field

    This is appended to the field's description.

If the override-description option is included, the directive content will replace the entire field description.

Project setup

Kitbash is published on PyPI and can be installed with:

pip install pydantic-kitbash

After adding Kitbash to your Python project, update Sphinx's conf.py file to include Kitbash as one of its extensions:

extensions = [
    "pydantic_kitbash",
]

Community and support

You can report any issues or bugs on the project's GitHub repository.

Kitbash is covered by the Ubuntu Code of Conduct.

License and copyright

Kitbash is released under the LGPL-3.0 license.

@ 2025 Canonical Ltd.

Metadata

Release files for pydantic-kitbash 1.0.1

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

Source distribution (sdist)

Source distribution for pydantic-kitbash 1.0.1
File Size Uploaded Provenance
pydantic_kitbash-1.0.1.tar.gz 117.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pydantic-kitbash 1.0.1
File Interpreter ABI Platform
pydantic_kitbash-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 135.0 kB

Release files / pydantic_kitbash-1.0.1.tar.gz

Download URL pydantic_kitbash-1.0.1.tar.gz
Size 117.3 kB
Tags Source
SHA-256 checksum
How to use checksums
44ad7f851cbba3c9fdbc1e705d2b36bca455befbdc361d86ad53af421e2b2eb1
BLAKE2b-256 checksum
How to use checksums
e65d2d1916a0aafc290768ee06b233f5c8c1debb65562e853fc0b6220bf6d5f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 23, 2026.

Transparency log

Release files / pydantic_kitbash-1.0.1-py3-none-any.whl

Download URL pydantic_kitbash-1.0.1-py3-none-any.whl
Size 17.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a8055cea6f2e18e5e45336436107b527ae6ab7d32b686eeec95a7aaec18adf2
BLAKE2b-256 checksum
How to use checksums
0254c24ce86ecf25c67a4fe7f0f47fe742daf4ccafb3ba4c770baa0d88623778
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 23, 2026.

Transparency log

Security for pydantic-kitbash 1.0.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pydantic_kitbash-1.0.1.tar.gz

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 Feb 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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