JSON to Python dataclass
Generate Python dataclasses with type hints from a sample JSON document.
How to use
- Paste a JSON sample.
- Name the root class.
- Copy the generated Python code.
What it supports
Objects become nested @dataclass definitions; Optional marks nullable fields; lists infer the merged element type. Keys become snake_case fields; a comment keeps the original key when it differs. Input up to 2 MB, nesting to 40 levels.