--- id: flask-pydantic version: "0.14.0" license: unclear license_treatment: permissive maintenance: aging --- # Flask-Pydantic — Flask extension for integration with Pydantic library. License: permissive · Maintenance: aging · Downloads: 635.6K/mo ## What it is and what it does Flask-Pydantic is a Flask extension that bridges Flask request handling with Pydantic's validation framework. It provides a `@validate()` decorator that intercepts incoming HTTP requests, extracts parameters from query strings, request bodies, form data, and URL paths, validates them against Pydantic models, and makes the validated data available to your route handler either through function arguments or via Flask's request object. The decorator automatically returns a 400 response with detailed validation errors if any parameter fails validation. It supports customizing success status codes, handling multiple models in responses or request bodies, and leverages Pydantic's alias feature for field name mapping. The package depends on Flask, Pydantic, and typing_extensions, making it a lightweight addition to existing Flask applications that already use Pydantic. Use it for: - Validate incoming JSON request bodies against Pydantic models before processing in POST/PUT endpoints - Enforce type checking and required fields on query parameters without manual parsing or try-catch blocks - Parse and validate URL path parameters (e.g., `/users/`) as typed integers or other Pydantic-supported types - Combine validation of query, body, and form data in a single route handler with clear type hints - Automatically serialize Pydantic model instances back to JSON responses with optional field aliasing ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Adds Pydantic model validation to Flask route handlers, automatically parsing and validating query parameters, request bodies, form data, and URL path parameters. Yes, with conditions. Install if you are building Flask applications that already use Pydantic and want to reduce boilerplate around request validation. The low install friction, permissive license, and backing from the Pallets Community Ecosystem make it a safe choice. However, note that maintenance is aging (235 days since last release); verify compatibility with your specific Flask and Pydantic versions before adopting. ## Install pip install flask-pydantic uv add flask-pydantic poetry add flask-pydantic ## Installing Flask-Pydantic Before you install: Low friction install with three straightforward runtime dependencies. Maintenance status is aging—last release was 235 days ago—but the repository remains active and part of the Pallets Community Ecosystem, which provides organizational backing for Flask extensions. License in practice: Licensed under the MIT License (permissive), allowing free use, modification, and distribution with minimal restrictions. Quickstart: pip install Flask-Pydantic from flask import Flask from pydantic import BaseModel from flask_pydantic import validate app = Flask(__name__) class QueryModel(BaseModel): age: int @app.route('/', methods=['GET']) @validate() def get(query: QueryModel): return {'age': query.age} Requires Python 3.7 or later; Flask and Pydantic must be installed as runtime dependencies. Verify before relying: - Whether the aging maintenance status (235 days since last release) affects compatibility with recent Flask or Pydantic versions - Performance characteristics when validating large request payloads or complex nested models ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 635.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags flask request validation, pydantic flask integration, validate flask parameters, flask body validation, flask query parameter validation, request-validation, type-checking [View on SkillFed](https://skillfed.io/packages/flask-pydantic) · [View on PyPI](https://pypi.org/project/flask-pydantic/)