# Pydantic Validation

> Data validation, data parsing, configuration management, and type coercion using Pydantic.

- Skill: `lord1egypt/pydantic-validation-2` (Agent Skill)
- Install (CLI): `npx skillmds@latest add lord1egypt/pydantic-validation-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/lord1egypt/pydantic-validation-2/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: MIT license
- Author: Lord1Egypt (https://skillmd.com/u/lord1egypt)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/lord1egypt/pydantic-validation-2

---


# Pydantic Validation

## Overview
Pydantic is the most widely used data validation library for Python, enforcing type hints at runtime.

## When to Use This Skill
Use to validate configuration files, API payloads, or parse outputs from AI agents.

## Quick Start (with runnable code examples)

```python
from pydantic import BaseModel, Field, EmailStr

class UserProfile(BaseModel):
    id: int
    name: str = Field(min_length=2)
    email: EmailStr
    is_active: bool = True

user = UserProfile(id=1, name="Akim", email="akim.221992@gmail.com")
print(user.model_dump())
```

## Advanced Usage
Set up custom validators (`@field_validator`), dynamic model schemas, and base settings management.

## Key References
- [Pydantic Documentation](https://docs.pydantic.dev/)

## Dependencies
- pydantic[email]>=2.0.0

