Type-hint-driven data validation that runs on Pydantic v2's Rust core for FastAPI, Django, and config work.

skills.sh installs
2.2K
GitHub stars
80
last updated
May 16, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers BaseModel definitions, field constraints, custom types, field and model validators, and v1-to-v2 migration mapping
  • Includes built-in types such as EmailStr, HttpUrl, SecretStr, FilePath, and Json, plus constrained and Literal types
  • Provides model_dump, model_validate, and model_validate_json in place of the deprecated v1 .dict(), .parse_obj(), and .parse_raw()
  • Designed for API request and response validation, settings management, ORM model checks, and typed CLI parsing

Install

$ npx -y skills add bobmatnyc/claude-mpm-skills --skill pydantic -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Pydantic Validation Skill

Summary

Python data validation using type hints and runtime type checking with Pydantic v2's Rust-powered core for high-performance validation.

When to Use

  • API request/response validation (FastAPI, Django)
  • Settings and configuration management (env variables, config files)
  • ORM model validation (SQLAlchemy integration)
  • Data parsing and serialization (JSON, dict, custom formats)
  • Type-safe data classes with automatic validation
  • CLI argument parsing with type safety

Quick Start

from pydantic import BaseModel, Field, EmailStr
from datetime import datetime

class User(BaseModel):
    id: int
    name: str = Field(..., min_length=1, max_length=100)
    email: EmailStr
    created_at: datetime = Field(default_factory=datetime.now)
    is_active: bool = True

# Validate data
user = User(id=1, name="Alice", email="alice@example.com")
print(user.model_dump())  # {'id': 1, 'name': 'Alice', ...}

# Automatic type coercion
user2 = User(id="2", name="Bob", email="bob@example.com")
assert user2.id == 2  # String "2" coerced to int

Details

Repository
github.com/bobmatnyc/claude-mpm-skills
Categories
Python, Backend & APIs

More from bobmatnyc/claude-mpm-skills

All 154

Similar to Pydantic

More Python