Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Generate swagger definitions from sphinx docs

Project Description

Generates a swagger API definition directly from httpdomain based documentation.


  1. Enable the extension in your by adding 'sphinxswagger' to the extensions list
  2. Run the swagger builder (e.g., swagger)
  3. Use the generated swagger.json

Setuptools Command

This library installs a new command named swagger that is available from the utility. It runs sphinx to generate the swagger output file. It is similar to running sphinx-build -b swagger except that it has access to your packages metadata so you don’t have to configure it in two places!

This is the recommend approach for using this package.

You can configure the output file name in your project’s setup.cfg in the [swagger] section:

output-file = static/swagger.json

This makes it easier to include it directly into your built artifact by adding it as package_data in Remember to add it to your as well.


This extension contains a few useful configuration values that can be set from within the sphinx configuration file.

 Sets the description of the application in the generated swagger file. If this is not set, then the “description” value in html_theme_options will be used if it is set.
swagger_file:Sets the name of the generated swagger file. The file is always generated in the sphinx output directory – usually build/sphinx/swagger. The default file name is swagger.json.
 A dictionary that describes the license that governs the API. This is written as-is to the License section of the API document. It should contain two keys – name and url.

Release History

This version
History Node


History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(12.3 kB) Copy SHA256 Hash SHA256
Wheel py2.py3 Jul 1, 2017
(9.0 kB) Copy SHA256 Hash SHA256
Source None Jul 1, 2017

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting