JSON to Python Classes
Turn a JSON sample into Pydantic models or dataclasses.
Generate Python Classes from JSON
Typed models make API data easier to work with and catch mistakes early. This page opens JSON to Types with Pydantic chosen, and dataclasses one click away.
Types used
Values map to str, int, float, bool and List[...]. Fields that are missing or null in the sample become Optional[...] with a default of None.
Related tools
To validate the same data with any language, generate a JSON Schema. To convert the JSON to YAML or CSV, use the JSON converter.