# python-attrs/cattrs

Composable custom class converters for attrs, dataclasses and friends.

Repository: https://github.com/python-attrs/cattrs
Canonical: https://ross.abutalabs.com/products/cattrs
Homepage: https://catt.rs
Language: Python
License: MIT
License Family: permissive
Topics: attrs, deserialization, serialization
Last push: 2026-08-09T20:01:37+00:00

## Health v2 (maintenance only)
Score: 84/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 96, release rhythm 59, longevity 100
- inputs: {"age_days": 3657, "days_push": 24, "days_rel": 196, "gap_med": 66, "n_releases_24m": 8}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1050, forks 152 (observed 2026-08-28T04:03:22.931973+00:00)

## What it is
cattrs is a Python library for converting unstructured data like dictionaries into attrs classes and dataclasses and back, with validation. It supports recursive structuring/unstructuring of complex and nested types with customizable hooks.

## Use cases
- convert json dicts into python attrs classes
- serialize dataclasses to dictionaries
- deserialize nested api payloads into typed objects
- validate unstructured data at system edges
- register custom converters for specific types

## When to choose
- you use attrs classes or dataclasses and need flexible (un)structuring
- you need recursive conversion of complex nested types
- you want validation separated from your data model

## When to avoid
- you need a full schema-based validation framework like pydantic
- your data model doesn't use attrs or dataclasses
- you only need simple json encoding of plain dicts

## Facets
- artifact type: library
- maturity: active
- function: serialization, form-handling, parser
- domain: developer-tools, apis
- platform: python, cross-platform
- tags: attrs, dataclasses, structuring, deserialization, type-driven, data-engineering

## Member repositories
- python-attrs/cattrs (main) score 84

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:22.931973+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:00:24.205931+00:00, confidence not recorded.
  - readme: https://github.com/python-attrs/cattrs (fetched 2026-08-28T04:03:22.931973+00:00, sha 3d07255df0cf)
  - registry_pypi: https://pypi.org/pypi/cattrs/json (fetched 2026-08-29T13:02:31.705164+00:00, sha 7c657b9e2781)
- Data as of 2026-08-30T08:39:29.467469+00:00.
