--- id: cattrs version: "26.1.0" license: MIT license_treatment: permissive maintenance: active --- # cattrs — Composable complex class support for attrs and dataclasses. License: permissive · Maintenance: active · Popularity: top 1,000 on PyPI ## Install pip install cattrs uv add cattrs poetry add cattrs ## Description # *cattrs*: Flexible Object Serialization and Validation *Because validation belongs to the edges.* [![Documentation](https://img.shields.io/badge/Docs-Read%20The%20Docs-black)](https://catt.rs/) [![License: MIT](https://img.shields.io/badge/license-MIT-C06524)](https://github.com/hynek/stamina/blob/main/LICENSE) [![PyPI](https://img.shields.io/pypi/v/cattrs.svg)](https://pypi.python.org/pypi/cattrs) [![Supported Python Versions](https://img.shields.io/pypi/pyversions/cattrs.svg)](https://github.com/python-attrs/cattrs) [![Downloads](https://static.pepy.tech/badge/cattrs/month)](https://pepy.tech/project/cattrs) [![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/Tinche/22405310d6a663164d894a2beab4d44d/raw/covbadge.json)](https://github.com/python-attrs/cattrs/actions/workflows/main.yml) --- **cattrs** is a Swiss Army knife for (un)structuring and validating data in Python. In practice, that means it converts **unstructured dictionaries** into **proper classes** and back, while **validating** their contents. ## Example _cattrs_ works best with... ## AI interpretation — verify before relying cattrs converts unstructured dictionaries into typed Python classes (attrs, dataclasses) and back, with recursive validation and support for complex nested structures and multiple serialization formats. Verdict: cattrs is a production-stable, actively maintained library with no known vulnerabilities, low install friction, and permissive MIT licensing. It excels at converting between unstructured data and typed Python objects with minimal boilerplate, making it well-suited for serialization, API validation, and data transformation pipelines. [View on SkillFed](https://skillfed.io/packages/cattrs) · [View on PyPI](https://pypi.org/project/cattrs/)