Metadata-Version: 2.4
Name: pydantic-response-models
Version: 0.1.0
Summary: Standard API response DTOs using Pydantic (framework-agnostic)
Author-email: GridFlow Team <vialogue@proton.me>
License: MIT
Project-URL: Homepage, https://github.com/firstunicorn/python-web-toolkit
Project-URL: Repository, https://github.com/firstunicorn/python-web-toolkit
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: pydantic>=2.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: ruff; extra == "dev"

# pydantic-response-models

Standard API response DTOs using Pydantic (framework-agnostic).

## Installation

```bash
pip install pydantic-response-models
```

## Usage

```python
from pydantic_response_models import (
    SuccessResponse,
    ErrorResponse,
    PaginatedResponse,
    MessageResponse,
    email_field,
    token_field
)
from pydantic import BaseModel

# Success response
response = SuccessResponse(data={"id": 1, "name": "John"})

# Error response
error = ErrorResponse(error="Not found", code="404")

# Paginated response
paginated = PaginatedResponse(
    items=[...],
    total=100,
    page=1,
    page_size=20,
    pages=5
)

# Use field factories in your models
class LoginRequest(BaseModel):
    email: str = email_field()
    token: str = token_field()
```

## Features

- ✅ Generic response wrappers
- ✅ Type-safe with Pydantic
- ✅ Framework-agnostic (works with FastAPI, Flask, Django, etc.)
- ✅ Consistent field definitions
- ✅ Pagination support

## License

MIT






