skillfed

annotated-types

Reusable constraint types to use with typing.Annotated

annotated-types Permissive license MIT Active 608 v0.8.0 released

Install

annotated-types on PyPI

pip

pip install annotated-types

uv

uv add annotated-types

poetry

poetry add annotated-types

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 21 days since the last release
Last repo commit
First released
Popularity one of the 100 most-downloaded packages on PyPI (30-day window, as of 2026-08-13)
Known vulnerabilities none known (OSV.dev, checked 2026-08-13)

Evidence: annotated_types-0.8.0-py3-none-any.whl

Development Status :: 4 - BetaEnvironment :: ConsoleEnvironment :: MacOS XIntended Audience :: DevelopersIntended Audience :: Information TechnologyLicense :: OSI Approved :: MIT LicenseOperating System :: POSIX :: LinuxOperating System :: UnixProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

About annotated-types

from the package's own PyPI description — quoted content, verbatim

annotated-types

CI (image) pypi (image) versions (image) license (image)

PEP-593 added typing.Annotated as a way of adding context-specific metadata to existing types, and specifies that Annotated[T, x] should be treated as T by any tool or library without special logic for x.

This package provides metadata objects which can be used to represent common constraints such as upper and lower bounds on scalar values and collection sizes, a Predicate marker for runtime checks, and descriptions of how we intend these metadata to be interpreted. In some cases, we also note alternative representations which...

Read as markdown · JSON record · Source repository · Homepage

AI interpretation — verify before relying

AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page

Provides reusable metadata objects for use with `typing.Annotated` to express common constraints like bounds, lengths, and predicates on values without requiring runtime checks.

Installs with zero runtime dependencies and low friction; actively maintained with recent releases and a healthy repository signal.

MIT license permits unrestricted use, modification, and distribution in both open and closed projects.

Usage

pip install annotated-types

from typing import Annotated
from annotated_types import Gt, Len

age: Annotated[int, Gt(18)]
my_list: Annotated[list[int], Len(0, 10)]

Requires Python 3.10 or later.

Verdict: A lightweight, zero-dependency library for expressing type constraints via PEP 593 annotations. Active maintenance, MIT license, and top-100 popularity make it a safe choice for projects needing declarative constraint metadata without runtime overhead.

Needs verification

  • Whether downstream libraries actually interpret these metadata objects or if they are purely informational.
  • Performance characteristics when used with large-scale type checking or validation frameworks.
typing.Annotated metadata constraintstype hints with bounds and validationpep 593 constraint markersruntime predicate annotationslength and value range metadata

Similar packages