--- id: annotated-types version: "0.8.0" license: MIT license_treatment: permissive maintenance: active --- # annotated-types — Reusable constraint types to use with typing.Annotated License: permissive · Maintenance: active · Popularity: top 100 on PyPI ## Install pip install annotated-types uv add annotated-types poetry add annotated-types ## Description # annotated-types [![CI](https://github.com/annotated-types/annotated-types/workflows/CI/badge.svg?event=push)](https://github.com/annotated-types/annotated-types/actions?query=event%3Apush+branch%3Amain+workflow%3ACI) [![pypi](https://img.shields.io/pypi/v/annotated-types.svg)](https://pypi.python.org/pypi/annotated-types) [![versions](https://img.shields.io/pypi/pyversions/annotated-types.svg)](https://github.com/annotated-types/annotated-types) [![license](https://img.shields.io/github/license/annotated-types/annotated-types.svg)](https://github.com/annotated-types/annotated-types/blob/main/LICENSE) [PEP-593](https://peps.python.org/pep-0593/) 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... ## AI interpretation — verify before relying Provides reusable metadata objects for use with `typing.Annotated` to express common constraints like bounds, lengths, and predicates on values without requiring runtime checks. 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. [View on SkillFed](https://skillfed.io/packages/annotated-types) · [View on PyPI](https://pypi.org/project/annotated-types/)