Skip to main content

swagger_ui_bundle

This package contains the static files for swagger-ui as a python package.

Basic configuration options are templated with the Jinja2 templating language.

This package is intended to be webserver-agnostic, so it only includes the static files, and some very basic configuration.

Getting Started

You can import the swagger_ui_path from the swagger_ui_bundle package like so:

from swagger_ui_bundle import swagger_ui_path

# or if you need a specific version
from swagger_ui_bundle import swagger_ui_2_path
from swagger_ui_bundle import swagger_ui_3_path

You can easily serve up this directory as all static files to get the default swagger-ui distribution. Here’s an example in flask:

from swagger_ui_bundle import swagger_ui_path

from flask import Flask, Blueprint, send_from_directory, render_template

swagger_bp = Blueprint(
    'swagger_ui',
    __name__,
    static_url_path='',
    static_folder=swagger_ui_path,
    template_folder=swagger_ui_path
)

app = Flask(__name__, static_url_path='')
app.register_blueprint(swagger_bp, url_prefix='/ui')

if __name__ == "__main__":
    app.run()

You may wish to override some of the configuration variables. Included is a jinaj2 templated file where you can modify these parameters. You can add another route to render this template with your desired configuration like so:

SWAGGER_UI_CONFIG = {
    "openapi_spec_url": "https://petstore.swagger.io/v2/swagger.json"
}

@swagger_bp.route('/')
def swagger_ui_index():
    return render_template('index.j2', **SWAGGER_UI_CONFIG)

Have a look at example.py for a complete server for the Flask webserver.

License

Since this is just repackaging swagger-ui releases, the license comes from the swagger ui project (https://github.com/swagger-api/swagger-ui).

All vendored code is published by SmartBear Software under the Apache 2.0 License.

Metadata

Release files for swagger-ui-bundle 0.0.5

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

Source distribution (sdist)

Source distribution for swagger-ui-bundle 0.0.5
File Size Uploaded Provenance Actions
swagger_ui_bundle-0.0.5.tar.gz 3.3 MB Without provenance Details for swagger_ui_bundle-0.0.5.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for swagger-ui-bundle 0.0.5
File Interpreter ABI Platform Actions
swagger_ui_bundle-0.0.5-py3-none-any.whl Python 3 none any Details for swagger_ui_bundle-0.0.5-py3-none-any.whl
swagger_ui_bundle-0.0.5-py2-none-any.whl Python 2 none any Details for swagger_ui_bundle-0.0.5-py2-none-any.whl

Total release size: 10.1 MB

Release files / swagger_ui_bundle-0.0.5.tar.gz

Download URL swagger_ui_bundle-0.0.5.tar.gz
Size 3.3 MB
Tags Source
SHA-256 checksum
How to use checksums
01ae8fdb1fa4e034933e0874afdda0d433dcb94476fccb231b66fd5f49dac96c
BLAKE2b-256 checksum
How to use checksums
8f2cf6e9aaf3d574dbae5c2bb8f02cb92f27d1ea25009a65c3d105811804225f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.19.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/2.7.15+

Release files / swagger_ui_bundle-0.0.5-py3-none-any.whl

Download URL swagger_ui_bundle-0.0.5-py3-none-any.whl
Size 3.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e88bd0d8334d685440a85210ff1e1083a0caabd4c36fa061843067ff4c2ac680
BLAKE2b-256 checksum
How to use checksums
3f83ab76dbaf88292cd32dcfbc7256e0c1b63411fa04d1439bb306bdc338916a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.3

Release files / swagger_ui_bundle-0.0.5-py2-none-any.whl

Download URL swagger_ui_bundle-0.0.5-py2-none-any.whl
Size 3.4 MB
Tags Python 2
SHA-256 checksum
How to use checksums
802f160dd6fe1d6b8fa92c6a40f593ef52f87ad0f507b1170ad2067f03de4c01
BLAKE2b-256 checksum
How to use checksums
afa2166862d191194535db2b14537da4c2b3762dfa7d8b1e1fc1d9c3ecb1817b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.19.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/2.7.15+

Security for swagger-ui-bundle 0.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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