☰
Home
/
Code Generators
/
JSON → Python
🐍
JSON → Python
Generate Python dataclass from JSON
☆
Bookmark
Loading tool…
JSON input
{ "id": 1, "name": "Ada Lovelace", "email": "ada@example.com", "isActive": true, "score": 98.6, "tags": ["admin", "developer"], "address": { "street": "123 Main St", "city": "London" }, "orders": [{ "id": 101, "total": 49.99, "shipped": false }] }
Python output
⧉ Copy
from __future__ import annotations from dataclasses import dataclass from typing import Any, Optional @dataclass class Address: street: str city: str @dataclass class Order: id: int total: float shipped: bool @dataclass class Root: id: int name: str email: str isActive: bool score: float tags: list[str] address: Address orders: list[Order]