CSV to Pydantic model
Paste a CSV and get a Pydantic v2 BaseModel for its rows: integers, decimals, booleans and ISO timestamps come out typed, and a column with empty cells becomes Optional. Handy for typing a csv.DictReader loop or a pandas ingest.
Inferred from the rows you paste, on the server, discarded after the response.
Example
sku,name,price,in_stock,created_at
A-100,Widget,9.99,true,2024-01-15T10:30:00Z
B-220,Gadget,19.5,false,2024-02-01T08:00:00Z
C-330,Doohickey,4.25,true,2024-03-11T14:45:00Z
from datetime import datetime
from pydantic import BaseModel
class Record(BaseModel):
id: int
sku: str
name: str
price: float
in_stock: bool
created_at: datetime