Install & Compatibility
Where this runs
tested against v25.7.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 46.4MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.2s · import 0.000s · 48MB
45MB installed
● package 45MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
api_doc
✓ from swagger_ui import api_doc
✗ from swagger_ui import get_swagger_ui_html
flask_api_doc
✓ from swagger_ui import flask_api_doc
tornado_api_doc
✓ from swagger_ui import tornado_api_doc
Integrate Swagger UI in a Flask app using the api_doc function.
from flask import Flask, jsonify, send_from_directory
from swagger_ui import api_doc
app = Flask(__name__)
@app.route('/spec')
def spec():
return jsonify({
"openapi": "3.0.0",
"info": {"title": "Sample API", "version": "1.0.0"},
"paths": {}
})
# Serve swagger UI at /docs, with spec at /spec
api_doc(app, config={'spec_url': '/spec'})
if __name__ == '__main__':
app.run()
Upgrade
Version history
25.7.1latest on PyPI · released Jul 1, 2025
Audit
Dependencies
tornadooptionalRequired for Tornado support
flaskoptionalRequired for Flask support
quartoptionalRequired for Quart support
sanicoptionalRequired for Sanic support
falconoptionalRequired for Falcon support