skillfed

flasgger

Extract swagger specs from your flask project

flasgger v0.9.7.1 859.6K downloads/30d#4,877 on PyPI3,741
Permissive license MIT DORMANT released

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 flasgger

uv

uv add flasgger

poetry

poetry add flasgger

Installing 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

Intended Audience :: DevelopersProgramming Language :: Python :: 3Programming Language :: Python :: 3.6

Tags

flask api documentationswagger ui for flaskopenapi spec generatorflask request validationinteractive api docsflask rest documentationapi schema validation
api-documentationflask-extensionopenapi-swagger

More Dynamic Content packages