Example input/output
Input: {"name":"Ada","age":30,"active":true}
Output: from dataclasses import dataclass
@dataclass
class Root:
name: str
age: int
active: bool
How it works
This tool parses the JSON object and infers Python types for each field (str, int, float, bool, list, dict). It generates a @dataclass class with typed field annotations. For nested objects, additional dataclasses are generated recursively. Processing runs in your browser.
Common use cases
- Generate Python dataclass definitions from a JSON API response
- Scaffold typed Python models from JSON schema quickly
- Create data classes for deserialising JSON in Python applications