skillfed

swagger-plugin-for-sphinx

Sphinx plugin which renders a OpenAPI specification with Swagger

swagger-plugin-for-sphinx v7.2.1 3.8M downloads/30d#2,483 on PyPI10
Permissive license Apache-2.0 Active released

What it is and what it does

This is a Sphinx extension that brings OpenAPI specification rendering into your documentation build. It acts as a bridge between Sphinx's documentation generation and Swagger UI, letting you embed interactive API explorers directly into your HTML docs. The plugin uses a simple directive to include OpenAPI YAML or JSON files, automatically copying them into your build output and rendering them with Swagger UI's interactive interface.

The plugin depends on Sphinx, Jinja2, docutils, PyYAML, and typing_extensions to handle template rendering, specification parsing, and documentation generation. It supports multiple specifications per page with unique IDs, optional full-page rendering modes, and custom Swagger configuration options. You can point to CDN-hosted Swagger assets or mirror them locally into your documentation tree for offline or self-hosted deployments.

Use it for:

  • Embed live API documentation in Sphinx-generated project docs alongside narrative guides
  • Render multiple OpenAPI specs on a single page with separate Swagger UI containers
  • Self-host API documentation by mirroring Swagger UI assets into your build output
  • Generate full-page Swagger UI views as part of your documentation site
  • Pass custom Swagger configuration options to control UI behavior and appearance

Worth the install?

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

A Sphinx plugin that embeds interactive Swagger UI pages into documentation to render OpenAPI specifications with customizable configuration and optional local resource mirroring.

Yes. The plugin is actively maintained, has no known vulnerabilities, carries a permissive license, and installs with low friction. It directly solves the problem of embedding interactive API docs into Sphinx projects. Install it if you use Sphinx and need to include OpenAPI specifications in your documentation.

Install

swagger-plugin-for-sphinx on PyPI

pip

pip install swagger-plugin-for-sphinx

uv

uv add swagger-plugin-for-sphinx

poetry

poetry add swagger-plugin-for-sphinx

Installing swagger-plugin-for-sphinx

Before you install

Low friction installation with a pure-Python wheel and five stable runtime dependencies. Active maintenance with a recent release (74 days ago) and ongoing repository activity.

License in practice

Apache-2.0 permissive license allows commercial and private use with minimal restrictions; you must retain copyright and license notices.

Quickstart

pip install swagger-plugin-for-sphinx

# In conf.py:
extensions = ["swagger_plugin_for_sphinx"]

# In your .rst file:
.. swagger-plugin:: path/to/spec.yaml

Verify before relying

  • Whether the plugin handles multiple OpenAPI versions or only specific versions
  • Performance characteristics when embedding large or complex OpenAPI specifications
  • Browser compatibility requirements for the generated Swagger UI pages

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (<4,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 5 — sphinx, jinja2, docutils, pyyaml, typing_extensions
Maintenance actively maintained — 74 days since the last release
Last repo commit
First released
Downloads 3,840,196/month — #2,483 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: swagger_plugin_for_sphinx-7.2.1-py3-none-any.whl

Keywords: sphinx, swagger, plugin, openapi

Development Status :: 5 - Production/StableEnvironment :: PluginsFramework :: Sphinx :: ExtensionIntended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: DocumentationTopic :: Documentation :: SphinxTyping :: Typed

Tags

sphinx openapi documentationswagger ui sphinx pluginembed swagger in docsopenapi spec renderersphinx api documentationinteractive api docs sphinxswagger-ui integration
api-documentationopenapisphinx-extension

More Documentation packages

docutils

Docutils converts plaintext documentation in…

unclear · top 1,000 on PyPI

Sphinx

Sphinx generates professional documentation…

permissive · top 1,000 on PyPI

griffe

Griffe extracts the complete structure and…

permissive · top 1,000 on PyPI

sphinxcontrib-serializinghtml

A Sphinx extension that outputs documentation…

permissive · top 1,000 on PyPI

alabaster

Alabaster is a clean, responsive Sphinx theme…

permissive · top 1,000 on PyPI

sphinxcontrib-htmlhelp

A Sphinx extension that generates HTML help…

permissive · top 1,000 on PyPI

sphinxcontrib-openapi

Sphinx extension that renders OpenAPI (Swagger)…

permissive · top 15,000 on PyPI

mkdocs-swagger-ui-tag

A MkDocs plugin that embeds Swagger UI directly…

permissive · top 15,000 on PyPI

mkdocs-render-swagger-plugin

Renders Swagger and OpenAPI schemas as…

permissive · top 15,000 on PyPI

swagger-ui-py

Integrates Swagger UI documentation into Python…

permissive · top 15,000 on PyPI

sphinxcontrib-redoc

A Sphinx extension that embeds OpenAPI…

permissive · top 15,000 on PyPI

flask-swagger-ui

Adds Swagger UI to Flask applications as a…

permissive · top 5,000 on PyPI

sphinx-comments

Integrates third-party commenting and…

permissive · top 15,000 on PyPI

django-rest-swagger

Generates Swagger UI documentation and OpenAPI…

permissive · top 15,000 on PyPI

flask-openapi3-swagger

Provides Swagger UI integration for…

permissive · top 15,000 on PyPI

aiohttp-swagger

Generates Swagger API documentation and…

permissive · top 15,000 on PyPI