Description
# Pydantic Extra Types [](https://github.com/pydantic/pydantic-extra-types/actions/workflows/ci.yml) [](https://codecov.io/gh/pydantic/pydantic-extra-types) [](https://pypi.python.org/pypi/pydantic-extra-types) [](https://github.com/pydantic/pydantic-extra-types/blob/main/LICENSE) A place for pydantic types that probably shouldn't exist in the main pydantic lib. See [pydantic/pydantic#5012](https://github.com/pydantic/pydantic/issues/5012) for more info. ## Installation Install this library with the desired extras dependencies as listed in [project.optional-dependencies](./pyproject.toml). For example, if pendulum support was desired: ```shell # via uv $ uv add "pydantic-extra-types[pendulum]" # via pip $ pip install -U "pydantic-extra-types[pendulum]" ```
Release History
| Version | Changes | Urgency | Date |
|---|---|---|---|
| 2.11.1 | Imported from PyPI (2.11.1) | Low | 4/21/2026 |
| v2.11.2 | ## What's Changed * fix: accept common timezone abbreviations like EDT in TimeZoneName validator by @r266-tech in https://github.com/pydantic/pydantic-extra-types/pull/376 * fix: correct ISO 8601 serialization for negative pendulum Duration values by @r266-tech in https://github.com/pydantic/pydantic-extra-types/pull/377 * β¬ Bump the python-packages group with 3 updates by @dependabot[bot] in https://github.com/pydantic/pydantic-extra-types/pull/378 * fix(python): add missing Pendulum Interv | Medium | 4/5/2026 |
| v2.11.1 | ## What's Changed * π fix Cron Tests (Happy New Year π ) by @anthonycicc in https://github.com/pydantic/pydantic-extra-types/pull/361 * β¬ Bump actions/upload-artifact from 5 to 6 by @dependabot[bot] in https://github.com/pydantic/pydantic-extra-types/pull/362 * β¬ Bump actions/download-artifact from 6 to 7 by @dependabot[bot] in https://github.com/pydantic/pydantic-extra-types/pull/363 * β¬ Bump the python-packages group with 4 updates by @dependabot[bot] in https://github.com/pydantic/pydan | Low | 3/15/2026 |
| v2.11.0 | ## What's Changed * π docs: improve example formatting in PhoneNumber documentation by @hengky-kurniawan-1 in https://github.com/pydantic/pydantic-extra-types/pull/347 * Fix import typo in the script code's documentation by @wesley312 in https://github.com/pydantic/pydantic-extra-types/pull/349 * β¬ Bump actions/upload-artifact from 4 to 5 by @dependabot[bot] in https://github.com/pydantic/pydantic-extra-types/pull/350 * β¬ Bump astral-sh/setup-uv from 6 to 7 by @dependabot[bot] in https://gi | Low | 12/26/2025 |
| v2.10.6 | ## What's Changed * feat: update credit card brands by @LorhanSohaky in https://github.com/pydantic/pydantic-extra-types/pull/325 * Fix various documentation layout issues by @Viicos in https://github.com/pydantic/pydantic-extra-types/pull/328 * Added test coverage for DomainStr validation including punycode and invalid inputs by @rhealakhotia in https://github.com/pydantic/pydantic-extra-types/pull/330 * β¨ Add time parsing to `pendulum` by @yezz123 in https://github.com/pydantic/pydantic-ex | Low | 10/8/2025 |
| v2.10.5 | ## What's Changed * β¬ Bump astral-sh/setup-uv from 5 to 6 by @dependabot in https://github.com/pydantic/pydantic-extra-types/pull/314 * fix: Install `pre-commit` hooks with uv by @karta9821 in https://github.com/pydantic/pydantic-extra-types/pull/315 * bump uv lockfile by @07pepa in https://github.com/pydantic/pydantic-extra-types/pull/317 * Add path types by @irtimir in https://github.com/pydantic/pydantic-extra-types/pull/318 * feat: Support `Decimal` type in coordinates by @karta9821 in | Low | 5/29/2025 |
| v2.10.4 | ## What's Changed * Fix serialization of mongo_object_id by @MaximilianClemens in https://github.com/pydantic/pydantic-extra-types/pull/302 * Default to using system zoneinfo if available by @jelly in https://github.com/pydantic/pydantic-extra-types/pull/303 * fix: disallow bool as input value for ULID by @glowskir in https://github.com/pydantic/pydantic-extra-types/pull/305 * β¬ Update phonenumbers requirement from <9,>=8 to >=8,<10 in the python-packages group by @dependabot in https://gith | Low | 4/26/2025 |
| v2.10.3 | ## What's Changed * Add support for pymongo bson ObjectId by @Ale-Cas in https://github.com/pydantic/pydantic-extra-types/pull/290 * Fix checkdigit calculation for ISBN10 by @eumiro in https://github.com/pydantic/pydantic-extra-types/pull/292 * Make checksum calculation more descriptive by @eumiro in https://github.com/pydantic/pydantic-extra-types/pull/293 * Refactor validate_mac_address method by @eumiro in https://github.com/pydantic/pydantic-extra-types/pull/294 * fix (de-)serialization | Low | 3/9/2025 |
| v2.10.2 | ## What's Changed * Add back Python 3.8 support by @Viicos in https://github.com/pydantic/pydantic-extra-types/pull/249 * β¬ Bump astral-sh/setup-uv from 4 to 5 by @dependabot in https://github.com/pydantic/pydantic-extra-types/pull/282 * Preserve months when using the Pendulum Duration type by @gareththackeray in https://github.com/pydantic/pydantic-extra-types/pull/283 * β¨ Add type checking support and improve type hints across the codebase by @yezz123 in https://github.com/pydantic/pydanti | Low | 1/15/2025 |
| v2.10.1 | ## What's Changed * Allow build with python-ulid 3.0.0 by @sunpoet in https://github.com/pydantic/pydantic-extra-types/pull/225 * π¨ added automatic syntax-upgrade hook ~ pyupgrade by @janas-adam in https://github.com/pydantic/pydantic-extra-types/pull/229 * :fire: Revert adding pyupgrade as a hook in pre-commit by @yezz123 in https://github.com/pydantic/pydantic-extra-types/pull/230 * isolate url in Currency by @edasubert in https://github.com/pydantic/pydantic-extra-types/pull/235 * lower | Low | 12/6/2024 |
| v2.10.0 | ## What's Changed * Add semantic version type by @jbkroner in https://github.com/pydantic/pydantic-extra-types/pull/199 * β¬ Bump the python-packages group with 5 updates by @dependabot in https://github.com/pydantic/pydantic-extra-types/pull/201 * feature: Improve phone number validator by @mZbZ in https://github.com/pydantic/pydantic-extra-types/pull/202 * Feature: Add phone number validator by @mZbZ in https://github.com/pydantic/pydantic-extra-types/pull/203 * β¨ deprecate `semver` in fav | Low | 10/13/2024 |
| v2.9.0 | ### Types * Add Semantic version type. PR [#195](https://github.com/pydantic/pydantic-extra-types/pull/195) by @nikstuckenbrock * Add timezone name validation. PR [#193](https://github.com/pydantic/pydantic-extra-types/pull/193) by @07pepa ### Refactor * Replace try-except block by if-else statement. PR [#192](https://github.com/pydantic/pydantic-extra-types/pull/192) by @maxsos ### Dependencies * β¬ Bump the python-packages group with 4 updates. PR [#194](https://github.com/pyd | Low | 7/3/2024 |
| v2.8.2 | * π Preserve timezone information when validating Pendulum DateTimes. [#189](https://github.com/pydantic/pydantic-extra-types/pull/189) by @chrisguidry | Low | 6/14/2024 |
| v2.8.1 | ### Bug Fixes * π Fix Pendulum date time object to have correct typing. [#184](https://github.com/pydantic/pydantic-extra-types/pull/184) by [@07pepa](https://github.com/07pepa) ### Types * β¨ Add parsing of pendulum_dt from unix time and non-strict parsing. [#185](https://github.com/pydantic/pydantic-extra-types/pull/185) by [@07pepa](https://github.com/07pepa) | Low | 6/12/2024 |
| v2.8.0 | ### Refactor * β»οΈ refactor some functions & minor changes. [#180](https://github.com/pydantic/pydantic-extra-types/pull/180) by [@yezz123](https://github.com/yezz123) ### Internal * Allow requiring extra dependencies. [#178](https://github.com/pydantic/pydantic-extra-types/pull/178) by [@yezz123](https://github.com/yezz123) ### Types * Add ISO 15924 and tests. [#174](https://github.com/pydantic/pydantic-extra-types/pull/174) by [@07pepa](https://github.com/07pepa) * add native da | Low | 6/4/2024 |
| v2.7.0 | ## What's Changed * β¬ Bump the python-packages group with 1 update by @dependabot in https://github.com/pydantic/pydantic-extra-types/pull/150 * Added LanguageAlpha2 and LanguageName types by @odelmarcelle in https://github.com/pydantic/pydantic-extra-types/pull/153 * Added support for pendulum Dates by @Woody1193 in https://github.com/pydantic/pydantic-extra-types/pull/154 * β¬ Bump the python-packages group with 6 updates by @dependabot in https://github.com/pydantic/pydantic-extra-types/ | Low | 4/22/2024 |
| v2.6.0 | ## What's Changed * Allow python-ulid 2.x on Python 3.9 and later by @musicinmybrain in <https://github.com/pydantic/pydantic-extra-types/pull/131> * Do not pin the βmajorβ version of pycountry by @musicinmybrain in <https://github.com/pydantic/pydantic-extra-types/pull/132> * π€ Create dependabot.yml for updating GitHub action by @yezz123 in <https://github.com/pydantic/pydantic-extra-types/pull/134> * :memo: Refactor Documentation for ISBN and MAC address modules by @yezz123 in <https://gi | Low | 3/1/2024 |
| v2.5.0 | ## What's Changed * Add Pendulum DT support by @theunkn0wn1 in https://github.com/pydantic/pydantic-extra-types/pull/110 **Full Changelog**: https://github.com/pydantic/pydantic-extra-types/compare/v2.4.1...v2.5.0 | Low | 1/29/2024 |
| v2.4.1 | ## What's Changed * Fix refs blocking docs build by @sydney-runkle in https://github.com/pydantic/pydantic-extra-types/pull/125 ## New Contributors * @sydney-runkle made their first contribution in https://github.com/pydantic/pydantic-extra-types/pull/125 **Full Changelog**: https://github.com/pydantic/pydantic-extra-types/compare/v2.4.0...v2.4.1 | Low | 1/12/2024 |
| v2.4.0 | ## What's Changed * Add: New type ISBN by @lucasmucidas in https://github.com/pydantic/pydantic-extra-types/pull/116 * fix validate_digits actually allowing non digit characters by @romaincaillon in https://github.com/pydantic/pydantic-extra-types/pull/120 * β»οΈ refactor the `validate_brand` method & add new types by @yezz123 in https://github.com/pydantic/pydantic-extra-types/pull/56 * β Drop python 3.7 & support 3.12 by @yezz123 in https://github.com/pydantic/pydantic-extra-types/pull/122 | Low | 1/9/2024 |
| v2.3.0 | ## What's Changed * Upgrade pydantic version to >=2.5.2 by @hramezani in https://github.com/pydantic/pydantic-extra-types/pull/113 **Full Changelog**: https://github.com/pydantic/pydantic-extra-types/compare/v2.2.0...v2.3.0 | Low | 12/29/2023 |
| v2.2.0 | ## What's Changed * Add `long` and `short` format to `as_hex` by @DJRHails in https://github.com/pydantic/pydantic-extra-types/pull/93 * Refactor documentation by @Kludex in https://github.com/pydantic/pydantic-extra-types/pull/98 * β¨ add `ULID` type by @JeanArhancet in https://github.com/pydantic/pydantic-extra-types/pull/73 * Added `__get_pydantic_json_schema__` method with `format='tel'` by @hasansezertasan in https://github.com/pydantic/pydantic-extra-types/pull/106 ## New Contributo | Low | 12/12/2023 |
| v2.1.0 | ## What's Changed * β¨ add `MacAddress` type by @JeanArhancet in https://github.com/pydantic/pydantic-extra-types/pull/71 * :memo: fix usage of `MAC address` by @yezz123 in https://github.com/pydantic/pydantic-extra-types/pull/72 * Add docstrings for payment cards by @tpdorsey in https://github.com/pydantic/pydantic-extra-types/pull/77 * Fix mac adddress validation by @JeanArhancet in https://github.com/pydantic/pydantic-extra-types/pull/79 * Remove work in progress part from README.md by @ | Low | 8/25/2023 |
| v2.0.0 | ## What's Changed * Migrate `Color` & `Payment Card` by @yezz123 in https://github.com/pydantic/pydantic-extra-types/pull/2 * add `pydantic` to classifiers by @yezz123 in https://github.com/pydantic/pydantic-extra-types/pull/13 * remove dependencies caching by @yezz123 in https://github.com/pydantic/pydantic-extra-types/pull/16 * :bug: deprecate `__modify_schema__` method by @yezz123 in https://github.com/pydantic/pydantic-extra-types/pull/20 * Fix Color JSON schema generation by @dmontagu | Low | 6/30/2023 |
