A schema that reports rather than crashes
pythonPydantic collects every failure in a row instead of stopping at the first, which is the difference between a validation report and an exception.
from pydantic import BaseModel, EmailStr, Field, ValidationError class Attendee(BaseModel): email: EmailStr display_name: str = Field(min_length=2, max_length=80) tickets: int = Field(ge=1, le=4) rows = [{"email": "not-an-email", "display_name": "A", "tickets": 9}] for line_no, row in enumerate(rows, start=1): try: Attendee(**row) except ValidationError as exc: for error in exc.errors(): print(line_no, error["loc"][0], error["msg"]) # 1 email value is not a valid email address: ... # 1 display_name String should have at least 2 characters # 1 tickets Input should be less than or equal to 4