flasgger
Extract swagger specs from your flask project
What it is and what it does
Flasgger is a Flask extension that automatically generates OpenAPI specifications from your Flask application's routes and serves an interactive Swagger UI at a configurable endpoint. It reads API documentation from Flask view docstrings, external YAML files, Python dictionaries, or Marshmallow schemas, then uses that same specification to validate incoming POST, PUT, and PATCH request bodies against the defined schema.
The package integrates with Flask-RESTful resources and supports Marshmallow APISpec as a base template. It embeds Swagger UI directly, eliminating the need for external hosting or separate documentation tools. However, the project has not been actively maintained since 2023-05-18, and the fact sheet provides no runtime dependencies, suggesting a lightweight but potentially aging implementation.
Use it for:
- Auto-generate interactive API documentation for Flask REST APIs without writing separate documentation files.
- Validate incoming JSON request bodies against OpenAPI schemas defined in docstrings or YAML files.
- Provide a live, browsable Swagger UI for API consumers to explore and test endpoints.
- Maintain API specifications alongside code by embedding them in Flask view docstrings.
- Integrate API documentation into Flask-RESTful resource-based applications with minimal configuration.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Flasgger extracts OpenAPI specifications from Flask views and serves an embedded Swagger UI for interactive API documentation and request validation.
Yes, with conditions. Flasgger is suitable for Flask projects that need lightweight, embedded API documentation and request validation. However, install only if you can verify compatibility with your Flask and Python versions—the package has been dormant since 2023-05-18 and may have unresolved issues with modern versions. For new projects, consider actively maintained alternatives or check the GitHub repository for recent community forks.
Install
flasgger on PyPI
pip
pip install flasggeruv
uv add flasggerpoetry
poetry add flasggerInstalling flasgger
Before you install
Installation friction is high. The package has been dormant since its last release on 2023-05-18, with no recent maintenance activity. The repository remains archived as false on GitHub with 3741 stars, but the lack of recent updates may indicate compatibility issues with current dependencies.
License in practice
MIT license is permissive and places no restrictions on commercial or private use, modification, or redistribution, making it safe for most projects.
Quickstart
pip install flasgger
from flasgger import Swagger
swagger = Swagger(app)
@app.route('/colors/<palette>')
def colors(palette):
"""Example endpoint
---
parameters:
- name: palette
in: path
type: string
responses:
200:
description: A list of colors
"""
return {'colors': ['red', 'green', 'blue']}
Requires an existing Flask application; Marshmallow and apispec are optional dependencies for schema-based validation.
Verify before relying
- Current compatibility with modern Flask versions given the dormancy since 2023-05-18.
- Whether the package works with Python versions beyond 3.6 (the only version in classifiers).
- Status of OpenAPI 3.0 support mentioned in documentation versus actual implementation.
- Whether high install friction stems from compiled dependencies or dependency conflicts.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | dormant — 1,184 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 859,576/month — #4,877 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: flasgger-0.9.7.1.tar.gz
Tags
More Dynamic Content packages
MarkupSafe provides a text object that escapes…
permissive · top 100 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
soupsieveSoupsieve is a CSS selector library designed to…
permissive · top 100 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
FlaskFlask is a lightweight WSGI web application…
permissive · top 1,000 on PyPI
MakoMako compiles Python-embedded templates into…
permissive · top 1,000 on PyPI
flask-swaggerExtracts Swagger 2.0 API specifications from…
permissive · top 15,000 on PyPI
flask-apispecflask-apispec decorates Flask view functions…
permissive · top 15,000 on PyPI
flask-swagger-uiAdds Swagger UI to Flask applications as a…
permissive · top 5,000 on PyPI
APIFlaskAPIFlask is a lightweight web API framework…
permissive · top 15,000 on PyPI
apispecGenerates OpenAPI specification documents from…
permissive · top 5,000 on PyPI
swagger-ui-pyIntegrates Swagger UI documentation into Python…
permissive · top 15,000 on PyPI
flask-openapi3-swaggerProvides Swagger UI integration for…
permissive · top 15,000 on PyPI
flask-pydantic-specAdds OpenAPI documentation generation and…
unclear · top 15,000 on PyPI
flask-openapi3Builds REST APIs on Flask with automatic…
permissive · top 15,000 on PyPI
apispec-webframeworksProvides web framework plugins for apispec to…
permissive · top 15,000 on PyPI