Toolmanor

JSON to Python dataclass

Paste a JSON sample to get Python classes: @dataclass or Pydantic BaseModel, typing hints (Optional, list) and snake_case field names, originals noted.

How to generate Python classes from JSON

  1. Paste a JSON sample on the left or open a .json file; the Python code appears on the right.
  2. Choose @dataclass or Pydantic, and rename the root type if you like.
  3. Copy it or download the .py file.

Frequently asked questions

Related tools