site_name: Pydantic Validation
site_description: Data validation using Python type hints
strict: true
site_url: https://docs.pydantic.dev/

theme:
  name: 'material'
  custom_dir: 'docs/theme'
  palette:
    - media: '(prefers-color-scheme)'
      primary: pink
      accent: pink
      toggle:
        icon: material/brightness-auto
        name: 'Switch to light mode'
    - media: '(prefers-color-scheme: light)'
      scheme: default
      primary: pink
      accent: pink
      toggle:
        icon: material/brightness-7
        name: 'Switch to dark mode'
    - media: '(prefers-color-scheme: dark)'
      scheme: slate
      primary: pink
      accent: pink
      toggle:
        icon: material/brightness-4
        name: 'Switch to system preference'
  features:
    - content.tabs.link
    - content.code.annotate
    - content.code.copy
    - announce.dismiss
    - navigation.tabs
    - navigation.instant
    - navigation.instant.prefetch
    - navigation.instant.preview
    - navigation.instant.progress
    - navigation.path
    - navigation.sections
    - navigation.top
    - navigation.tracking
    - search.suggest
    - toc.follow
  logo: 'logo-white.svg'
  favicon: 'favicon.png'

repo_name: pydantic/pydantic
repo_url: https://github.com/pydantic/pydantic
edit_uri: edit/main/docs/
extra:
  version:
    provider: mike
  analytics:
    feedback:
      title: Was this page helpful?
      ratings:
        - icon: material/thumb-up-outline
          name: This page was helpful
          data: 1
          note: >-
            Thanks for your feedback!
        - icon: material/thumb-down-outline
          name: This page could be improved
          data: 0
          note: >-
            Thanks for your feedback!

# https://www.mkdocs.org/user-guide/configuration/#validation
validation:
  omitted_files: warn
  absolute_links: warn
  unrecognized_links: warn
  anchors: warn

extra_css:
  - 'extra/terminal.css'
  - 'extra/tweaks.css'
extra_javascript:
  - 'https://cdn.jsdelivr.net/npm/algoliasearch@5.20.0/dist/lite/builds/browser.umd.js'
  - 'https://cdn.jsdelivr.net/npm/instantsearch.js@4.77.3/dist/instantsearch.production.min.js'
  - 'extra/algolia.js'
  - 'extra/feedback.js'
  - 'extra/fluff.js'
  - 'extra/mathjax.js'
  - 'https://samuelcolvin.github.io/mkdocs-run-code/run_code_main.js'
  - 'https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js'

nav:
  - Get Started:
      - Welcome to Pydantic: index.md
      - Why use Pydantic: why.md
      - Help with Pydantic: help_with_pydantic.md
      - Installation: install.md
      - Migration Guide: migration.md
      - Version Policy: version-policy.md
      - Contributing: contributing.md
      - Changelog: changelog.md
  - Concepts:
      - Models: concepts/models.md
      - Fields: concepts/fields.md
      - JSON Schema: concepts/json_schema.md
      - JSON: concepts/json.md
      - Types: concepts/types.md
      - Unions: concepts/unions.md
      - Alias: concepts/alias.md
      - Configuration: concepts/config.md
      - Serialization: concepts/serialization.md
      - Validators: concepts/validators.md
      - Dataclasses: concepts/dataclasses.md
      - Forward Annotations: concepts/forward_annotations.md
      - Strict Mode: concepts/strict_mode.md
      - Type Adapter: concepts/type_adapter.md
      - Validation Decorator: concepts/validation_decorator.md
      - Conversion Table: concepts/conversion_table.md
      - Settings Management: concepts/pydantic_settings.md
      - Performance: concepts/performance.md
      - Experimental: concepts/experimental.md
  - API Documentation:
      - Pydantic:
          - BaseModel: api/base_model.md
          - RootModel: api/root_model.md
          - Pydantic Dataclasses: api/dataclasses.md
          - TypeAdapter: api/type_adapter.md
          - Validate Call: api/validate_call.md
          - Fields: api/fields.md
          - Aliases: api/aliases.md
          - Configuration: api/config.md
          - JSON Schema: api/json_schema.md
          - Errors: api/errors.md
          - Functional Validators: api/functional_validators.md
          - Functional Serializers: api/functional_serializers.md
          - Standard Library Types: api/standard_library_types.md
          - Pydantic Types: api/types.md
          - Network Types: api/networks.md
          - Version Information: api/version.md
          - Annotated Handlers: api/annotated_handlers.md
          - Experimental: api/experimental.md
      - Pydantic Core:
          - pydantic_core: api/pydantic_core.md
          - pydantic_core.core_schema: api/pydantic_core_schema.md
      - Pydantic Settings: api/pydantic_settings.md
      - Pydantic Extra Types:
          - Color: api/pydantic_extra_types_color.md
          - Country: api/pydantic_extra_types_country.md
          - Payment: api/pydantic_extra_types_payment.md
          - Phone Numbers: api/pydantic_extra_types_phone_numbers.md
          - Routing Numbers: api/pydantic_extra_types_routing_numbers.md
          - Coordinate: api/pydantic_extra_types_coordinate.md
          - Mac Address: api/pydantic_extra_types_mac_address.md
          - ISBN: api/pydantic_extra_types_isbn.md
          - Pendulum: api/pydantic_extra_types_pendulum_dt.md
          - Currency: api/pydantic_extra_types_currency_code.md
          - Language: api/pydantic_extra_types_language_code.md
          - Script Code: api/pydantic_extra_types_script_code.md
          - Semantic Version: api/pydantic_extra_types_semantic_version.md
          - Timezone Name: api/pydantic_extra_types_timezone_name.md
          - ULID: api/pydantic_extra_types_ulid.md
  - Internals:
      - Architecture: internals/architecture.md
      - Resolving Annotations: internals/resolving_annotations.md
  - Examples:
      - Validating File Data: examples/files.md
      - Web and API Requests: examples/requests.md
      - Queues: examples/queues.md
      - Databases: examples/orms.md
      - Custom Validators: examples/custom_validators.md
      - Dynamic models: examples/dynamic_models.md
      - Agent libraries – Pydantic AI: examples/pydantic_ai.md
  - Error Messages:
      - Error Handling: errors/errors.md
      - Validation Errors: errors/validation_errors.md
      - Usage Errors: errors/usage_errors.md
  - Integrations:
      - Pydantic Logfire: integrations/logfire.md
      - LLMs: integrations/llms.md
      - Dev Tools:
          - Mypy: integrations/mypy.md
          - Pyrefly: integrations/pyrefly.md
          - PyCharm: integrations/pycharm.md
          - Hypothesis: integrations/hypothesis.md
          - Visual Studio Code: integrations/visual_studio_code.md
          - datamodel-code-generator: integrations/datamodel_code_generator.md
          - devtools: integrations/devtools.md
          - Rich: integrations/rich.md
          - Linting: integrations/linting.md
          - Documentation: integrations/documentation.md
      - Production Tools:
          - AWS Lambda: integrations/aws_lambda.md
  - Blog: https://blog.pydantic.dev/
  - Pydantic People: pydantic_people.md

markdown_extensions:
  - tables
  - toc:
      permalink: true
      title: Page contents
  - admonition
  - pymdownx.details
  - pymdownx.superfences
  - pymdownx.highlight:
      pygments_lang_class: true
  - pymdownx.extra
  - pymdownx.emoji:
      emoji_index: !!python/name:material.extensions.emoji.twemoji
      emoji_generator: !!python/name:material.extensions.emoji.to_svg
  - pymdownx.tabbed:
      alternate_style: true
  - pymdownx.arithmatex:
      generic: true
  - pydantic_docs.mdext

watch:
  - pydantic

hooks:
  - 'docs/plugins/main.py'
  - 'docs/plugins/algolia.py'

plugins:
  - social
  - mike:
      alias_type: symlink
      canonical_version: latest
      # llmstxt must come after the mike plugin:
  - llmstxt:
      enabled: !ENV [CI, false]
      full_output: llms-full.txt
      markdown_description: |-
        Pydantic is the most widely used data validation library for Python.
        Fast and extensible, Pydantic plays nicely with your linters/IDE/brain.
        Define how data should be in pure, canonical Python 3.9+; validate it with Pydantic.
      sections:
        Concepts documentation:
          - concepts/*.md
        API documentation:
          - api/*.md
        Internals:
          - internals/*.md
        Optional:
          - errors/*.md
          - examples/*.md
          - integrations/*.md
  - search
  - exclude:
      glob:
        - theme/announce.html
        - plugins/*
        - __pycache__/*
  - mkdocstrings:
      handlers:
        python:
          paths: [.] # see also: build-docs.sh
          options:
            members_order: source
            separate_signature: true
            filters: ['!^_']
            docstring_options:
              ignore_init_summary: true
            merge_init_into_class: true
            show_signature_annotations: true
            signature_crossrefs: true
          import:
            - url: https://docs.python.org/3/objects.inv
              domains: [py, std]
            - url: https://typing-extensions.readthedocs.io/en/latest/objects.inv
  - redirects:
      redirect_maps:
        'usage/mypy.md': 'integrations/mypy.md'
        'mypy_plugin.md': 'integrations/mypy.md'
        'datamodel_code_generator.md': 'integrations/datamodel_code_generator.md'
        'visual_studio_code.md': 'integrations/visual_studio_code.md'
        'hypothesis_plugin.md': 'integrations/hypothesis.md'
        'pycharm_plugin.md': 'integrations/pycharm.md'
        'usage/model_config.md': 'api/config.md'
        'usage/devtools.md': 'integrations/devtools.md'
        'usage/rich.md': 'integrations/rich.md'
        'usage/linting.md': 'integrations/linting.md'
        'usage/types.md': 'concepts/types.md'
        'usage/types/secrets.md': 'api/types.md#pydantic.types.Secret'
        'usage/types/string_types.md': 'api/types.md#pydantic.types.StringConstraints'
        'usage/types/file_types.md': 'api/types.md#pydantic.types.FilePath'
        'api/main.md': 'api/base_model.md'
        'api/color.md': 'api/pydantic_extra_types_color.md'
        'api/alias_generators.md': 'api/config.md#pydantic.config.ConfigDict.alias_generator'
        'api/pydantic_core_init.md': 'api/pydantic_core.md'
        'usage/types/booleans.md': 'api/standard_library_types.md#booleans'
        'usage/types/callables.md': 'api/standard_library_types.md#callable'
        'usage/types/custom.md': 'concepts/types.md#custom-types'
        'usage/types/datetime.md': 'api/standard_library_types.md#datetime-types'
        'usage/types/enum.md': 'api/standard_library_types.md#enum'
        'usage/types/json.md': 'api/types.md#pydantic.types.Json'
        'usage/types/list_types.md': 'api/standard_library_types.md#list'
        'usage/types/standard_types.md': 'api/standard_library_types.md'
        'usage/types/strict_types.md': 'concepts/types.md#strict-types'
        'usage/types/types.md': 'concepts/types.md'
        'usage/types/urls.md': 'api/networks.md'
        'usage/types/unions.md': 'api/standard_library_types.md#union'
        'usage/types/typevars.md': 'api/standard_library_types.md#type-and-typevar'
        'usage/types/types_fields.md': 'api/standard_library_types.md'
        'usage/validation_errors.md': 'errors/validation_errors.md'
        'usage/errors.md': 'errors/usage_errors.md'
        'usage/types/extra_types/color_types.md': 'api/pydantic_extra_types_color.md'
        'usage/types/extra_types/extra_types.md': 'api/pydantic_extra_types_color.md'
        'usage/types/extra_types/coordinate.md': 'api/pydantic_extra_types_coordinate.md'
        'usage/types/extra_types/mac_address.md': 'api/pydantic_extra_types_mac_address.md'
        'usage/types/extra_types/payment_cards.md': 'api/pydantic_extra_types_payment.md'
        'usage/types/extra_types/phone_numbers.md': 'api/pydantic_extra_types_phone_numbers.md'
        'usage/types/extra_types/routing_numbers.md': 'api/pydantic_extra_types_routing_numbers.md'
        'version-compatibility.md': 'version-policy.md'
        'api/pydantic_extra_types_routing_number.md': 'api/pydantic_extra_types_routing_numbers.md'
        'usage/computed_fields.md': 'api/fields.md#pydantic.fields.computed_field'
        'usage/conversion_table.md': 'concepts/conversion_table.md'
        'usage/dataclasses.md': 'concepts/dataclasses.md'
        'usage/fields.md': 'concepts/fields.md'
        'usage/json_schema.md': 'concepts/json_schema.md'
        'usage/models.md': 'concepts/models.md'
        'usage/postponed_annotations.md': 'concepts/forward_annotations.md'
        'concepts/postponed_annotations.md': 'concepts/forward_annotations.md'
        'usage/pydantic_settings.md': 'concepts/pydantic_settings.md'
        'usage/serialization.md': 'concepts/serialization.md'
        'usage/strict_mode.md': 'concepts/strict_mode.md'
        'usage/type_adapter.md': 'concepts/type_adapter.md'
        'usage/validation_decorator.md': 'concepts/validation_decorator.md'
        'usage/validators.md': 'concepts/validators.md'
        'usage/types/bytesize.md': 'api/types.md#pydantic.types.ByteSize'
        'usage/types/dicts_mapping.md': 'api/standard_library_types.md#mapping-types'
        'usage/types/encoded.md': 'api/types.md#pydantic.types.EncodedBytes'
        'usage/types/enums.md': 'api/standard_library_types.md#enum'
        'usage/types/number_types.md': 'api/standard_library_types.md#number-types'
        'usage/types/sequence_iterable.md': 'api/standard_library_types.md#other-iterables'
        'usage/types/set_types.md': 'api/standard_library_types.md#sets'
        'usage/types/uuids.md': 'api/standard_library_types.md#uuid'
        'blog/pydantic-v2-alpha.md': 'https://pydantic.dev/articles/pydantic-v2-alpha'
        'blog/pydantic-v2-final.md': 'https://pydantic.dev/articles/pydantic-v2-final'
        'blog/pydantic-v2.md': 'https://pydantic.dev/articles/pydantic-v2'
        'examples/secrets.md': 'api/types.md#pydantic.types.Secret'
        'examples/validators.md': 'examples/custom_validators.md'
        'architecture.md': 'internals/architecture.md'
