Skip to main content

sphinx-swagger

Generates a swagger API definition directly from httpdomain based documentation.

Usage

  1. Enable the extension in your conf.py by adding 'sphinxswagger' to the extensions list

  2. Run the swagger builder (e.g., setup.py swagger)

  3. Use the generated swagger.json

Setuptools Command

This library installs a new command named swagger that is available from the setup.py 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:

[swagger]
output-file = static/swagger.json

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

Configuration

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

swagger_description:

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.

swagger_license:

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.

Metadata

Release files for sphinx-swagger 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinx-swagger 0.0.4
File Size Uploaded
sphinx-swagger-0.0.4.tar.gz 9.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinx-swagger 0.0.4
File Interpreter ABI Platform
sphinx_swagger-0.0.4-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 21.3 kB

Release files / sphinx-swagger-0.0.4.tar.gz

Download URL sphinx-swagger-0.0.4.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
02a56be438abf079a0f3f8dfefa2435179cb58415b4d3ff6aacb087276fc7ff3
BLAKE2b-256 checksum
How to use checksums
d86b2f4ce2d388049c7e8f76586f785333c2d4af114dadf5a9ae41d5654bf7bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / sphinx_swagger-0.0.4-py2.py3-none-any.whl

Download URL sphinx_swagger-0.0.4-py2.py3-none-any.whl
Size 12.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
3dffaca8229a5da35d4b6964716dbcac9fb097db12c65e05f4ba878d0e97e3f3
BLAKE2b-256 checksum
How to use checksums
91293b17ecdff0b60ca8b7995cf6d773d59a27a5272dac3ffb9ed3a9eb7205d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page