freshcrate
Home > Frameworks > pydantic-extra-types

pydantic-extra-types

Extra Pydantic types.

Description

# Pydantic Extra Types [![CI](https://github.com/pydantic/pydantic-extra-types/actions/workflows/ci.yml/badge.svg)](https://github.com/pydantic/pydantic-extra-types/actions/workflows/ci.yml) [![Coverage](https://codecov.io/gh/pydantic/pydantic-extra-types/branch/main/graph/badge.svg)](https://codecov.io/gh/pydantic/pydantic-extra-types) [![pypi](https://img.shields.io/pypi/v/pydantic-extra-types.svg)](https://pypi.python.org/pypi/pydantic-extra-types) [![license](https://img.shields.io/github/license/pydantic/pydantic-extra-types.svg)](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

VersionChangesUrgencyDate
2.11.1Imported from PyPI (2.11.1)Low4/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 IntervMedium4/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/pydanLow3/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://giLow12/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-exLow10/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 Low5/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://githLow4/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-)serializationLow3/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/pydantiLow1/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 * lowerLow12/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 favLow10/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/pydLow7/3/2024
v2.8.2* πŸ› Preserve timezone information when validating Pendulum DateTimes. [#189](https://github.com/pydantic/pydantic-extra-types/pull/189) by @chrisguidry Low6/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)Low6/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 daLow6/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/Low4/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://giLow3/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.0Low1/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.1Low1/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 Low1/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.0Low12/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 ContributoLow12/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 @Low8/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 Low6/30/2023

Dependencies & License Audit

Loading dependencies...

Similar Packages

pre-commitA framework for managing and maintaining multi-language pre-commit hooks.v4.6.0
azure-core-tracing-opentelemetryMicrosoft Azure Azure Core OpenTelemetry plugin Library for Pythonazure-template_0.1.0b6187637
spdx-toolsSPDX parser and tools.0.8.5
lacesDjango components that know how to render themselves.0.1.2
django-tasksA backport of Django's built in Tasks framework0.12.0