skillfed

swagger-ui-py

Swagger UI for Python web framework, such as Tornado, Flask, Quart, Sanic and Falcon.

swagger-ui-py v25.7.1 146.7K downloads/30d#11,091 on PyPI69
Permissive license Apache License 2.0 AGING released

What it is and what it does

Swagger-ui-py is a bridge that adds interactive Swagger UI documentation to Python web applications. It works with a wide range of frameworks—Flask, Tornado, Sanic, aiohttp, Quart, Starlette, Falcon, Bottle, and Chalice—by injecting a documentation endpoint that serves the Swagger UI interface. You provide an OpenAPI/Swagger specification (as a local YAML/JSON file, a remote URL, a Python dict, or a JSON string), and the package renders it as an interactive, browsable API explorer at a URL you choose.

The package depends on jinja2 for templating, packaging for version handling, and PyYaml for configuration parsing. It bundles Swagger UI v5.25.3 and Swagger Editor v4.14.6, allowing both read-only documentation viewing and optional in-browser editing of your API spec. Configuration is straightforward: a single function call with your app instance and spec source, plus optional parameters for Swagger UI behavior and OAuth2 settings.

Use it for:

  • Add interactive API documentation to a Flask or Tornado REST API without writing HTML or maintaining separate docs.
  • Serve Swagger UI from a local OpenAPI spec file in a multi-framework Python web application.
  • Enable in-browser editing of your API specification with the built-in Swagger Editor.
  • Integrate OAuth2 configuration into your API docs for testing authenticated endpoints.
  • Support multiple Python web frameworks with a single documentation integration pattern.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Integrates Swagger UI documentation into Python web frameworks (Flask, Tornado, Sanic, aiohttp, Quart, Starlette, Falcon, Bottle, Chalice) to serve interactive API documentation from OpenAPI/Swagger specifications.

Yes, if you need to add Swagger UI documentation to a Python web application. The package is straightforward to integrate, has low install friction, carries no known vulnerabilities, and works across many popular frameworks. The aging maintenance status (409 days since last release) is a minor concern but not a blocker—the repository is still active and the functionality is stable. Install it when you want interactive API docs without building custom documentation infrastructure.

Install

swagger-ui-py on PyPI

pip

pip install swagger-ui-py

uv

uv add swagger-ui-py

poetry

poetry add swagger-ui-py

Installing swagger-ui-py

Before you install

Low install friction with three lightweight runtime dependencies (jinja2, packaging, PyYaml). Maintenance status is aging—last release was 409 days ago—but the repository remains active and unarchived with recent commits.

License in practice

Licensed under Apache License 2.0 (permissive), allowing commercial and private use with minimal restrictions; suitable for most projects.

Quickstart

pip install swagger-ui-py

from swagger_ui import api_doc
api_doc(app, config_path='./config/test.yaml', url_prefix='/api/doc', title='API doc')

Requires Python 3.0 or later; your web framework (Flask, Tornado, etc.) must be installed separately.

Verify before relying

  • Whether the 409-day gap since last release signals maintenance concerns or stable maturity for this use case.
  • Performance characteristics when serving large or complex OpenAPI specifications.
  • Compatibility with the latest versions of supported frameworks (Flask, Tornado, Sanic, etc.).

Package facts

License Apache License 2.0 (permissive)
Python support supports the current Python release (>=3.0.0)
Install friction low — pure-Python wheel
Runtime dependencies 3 — jinja2, packaging, PyYaml
Maintenance aging — 409 days since the last release
Last repo commit
First released
Downloads 146,696/month — #11,091 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: swagger_ui_py-25.7.1-py3-none-any.whl

Tags

swagger ui python web frameworkopenapi documentation flask tornadointeractive api docs pythonswagger ui integrationapi documentation generator pythonopenapi spec viewerrest api docs python
api-documentationopenapi-swaggerweb-framework-integration

More Dynamic Content packages