Skip to main content

pydantic-response-models

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

Installation

pip install pydantic-response-models

Usage

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

Metadata

Release files for pydantic-response-models 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydantic-response-models 0.1.0
File Size Uploaded Provenance Actions
pydantic_response_models-0.1.0.tar.gz 4.2 kB Without provenance Details for pydantic_response_models-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pydantic-response-models 0.1.0
File Interpreter ABI Platform Actions
pydantic_response_models-0.1.0-py3-none-any.whl Python 3 none any Details for pydantic_response_models-0.1.0-py3-none-any.whl

Total release size: 7.6 kB

Release files / pydantic_response_models-0.1.0.tar.gz

Download URL pydantic_response_models-0.1.0.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6d829df4349b7c9ee63b8215a769ffdcd94edda0b9b847e5dd64a35307aad619
BLAKE2b-256 checksum
How to use checksums
888336de9e5fe23484ca8976dbe17b654f8d91df3ae7b389d3951d0b9bce1c31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / pydantic_response_models-0.1.0-py3-none-any.whl

Download URL pydantic_response_models-0.1.0-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f443d75d5f73588890af1d8f941460b98ead7a6795ba77fcb6a80c4bfeddf11
BLAKE2b-256 checksum
How to use checksums
bf0a838a3c11ae374f2a08b2754dde0e8fc3928900bc237e64413aedfdb74fdf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Security for pydantic-response-models 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page