You've got JSON and you want typed Python objects instead of raw dicts. There are three good targets — dataclass, TypedDict, and Pydantic — and they solve different problems. Here's how to choose.

The shape

{ "id": 1, "name": "Ada", "active": true }

Enter fullscreen mode

Exit fullscreen mode