Extra Types Overview

For types that are more complex, or don't need to be on Pydantic itself, we have the Pydantic Extra Types project.

Warning

To use this type, you need to install the optional pydantic-extra-types package:

pip install pydantic-extra-types

The following types are supported by Pydantic Extra Types:

  • Color Types — color validation types.
  • Payment Card Numbers — a type that allows you to store payment card numbers in your model.
  • Phone Numbers — a type that allows you to store phone numbers in your model.
  • Routing Numbers — a type that allows you to store ABA transit routing numbers in your model.
  • MAC Address — a type that allows you to store MAC addresses in your model.
  • Coordinate — a type that allows you to store the latitude and longitude in your model.