CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-pydantic

Data validation using Python type hints

90

1.30x
Overview
Eval results
Files

rubric.jsonevals/scenario-4/

{
  "context": "This criteria evaluates how well the engineer uses Pydantic's enum value serialization capability to create a validated user model with proper enum handling. The focus is on using BaseModel, ConfigDict with use_enum_values, and model serialization methods.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "BaseModel inheritance",
      "description": "User class inherits from pydantic.BaseModel to enable validation and serialization",
      "max_score": 20
    },
    {
      "name": "use_enum_values configuration",
      "description": "ConfigDict with use_enum_values=True is used to serialize enums as their values instead of enum instances",
      "max_score": 30
    },
    {
      "name": "Enum field typing",
      "description": "status field is properly typed as AccountStatus enum in the User model",
      "max_score": 15
    },
    {
      "name": "model_dump method",
      "description": "to_dict() method uses model_dump() to serialize the User instance to a dictionary",
      "max_score": 20
    },
    {
      "name": "model_validate usage",
      "description": "Uses model_validate() or direct initialization to create User instances from dictionaries, leveraging Pydantic's validation",
      "max_score": 15
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/pypi-pydantic

tile.json