JSON to Python Dataclass

Your workspaceProcessed on your device

Leave the pointer blank to use the full document. Use /items or /items/0 to pick a nested value.

A few things to know.

Uses up to 4,194,304 input and output characters, a 4 MiB UTF-8 file, 128 nested levels and 500,000 JSON tokens. Duplicate keys are rejected. Processing stays on this device.

  1. Paste JSON, open a local UTF-8 file or load the inventory example. Enter a model name and optionally select a nested root with a JSON Pointer.
  2. Choose a standard library dataclass, Pydantic v1 or Pydantic v2. Set the default policy for fields that are missing or carry null.
  3. Generate Python. Review snake_case names, original JSON keys, unions and defaults, then download models.py or copy the code.