or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/pydantic@2.11.x
tile.json

tessl/pypi-pydantic

tessl install tessl/pypi-pydantic@2.11.0

Data validation using Python type hints

Agent Success

Agent success rate when using this tile

90%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.3x

Baseline

Agent success rate without this tile

69%

task.mdevals/scenario-3/

Product Configuration Validator

A data validation system for product configurations with field-level constraints and metadata.

Capabilities

Validates numeric constraints

  • A product with price 50.0 passes validation @test
  • A product with price 0.5 fails validation (minimum 1.0) @test
  • A product with price 10000.0 passes validation (exactly at maximum) @test
  • A product with price 10000.1 fails validation (exceeds maximum) @test

Validates string length constraints

  • A product with name "Widget" (6 characters) passes validation @test
  • A product with name "AB" (2 characters) fails validation (minimum 3) @test
  • A product with name containing exactly 100 characters passes validation @test
  • A product with name containing 101 characters fails validation @test

Validates pattern matching

  • A product with SKU "PROD-12345" passes validation @test
  • A product with SKU "prod-12345" fails validation (must be uppercase) @test
  • A product with SKU "PROD-ABC" fails validation (must end with digits) @test

Handles default values and factories

  • Creating a product without stock_quantity defaults to 0 @test
  • Creating a product without tags defaults to an empty list @test
  • Multiple products created without tags have separate list instances @test

Implementation

@generates

API

from pydantic import BaseModel

class ProductConfig(BaseModel):
    """
    Validates product configuration data.

    Fields:
    - name: Product name (3-100 characters)
    - price: Product price (1.0 to 10000.0)
    - sku: Product SKU code (format: PROD-##### where # is a digit)
    - stock_quantity: Current stock level (defaults to 0, must be non-negative)
    - tags: List of product tags (defaults to empty list)
    """
    pass  # Implementation required

Dependencies { .dependencies }

pydantic { .dependency }

Provides data validation support.

@satisfied-by