swagger-4-ui-bundle


Nameswagger-4-ui-bundle JSON
Version 0.0.4 PyPI version JSON
download
home_pagehttps://github.com/bartsanchez/swagger_ui_bundle
Summaryswagger_4_ui_bundle - swagger-ui files in a pip package
upload_time2023-01-02 21:30:04
maintainer
docs_urlNone
authorDaniel Grossmann-Kavanagh, Bartolomé Sánchez Salado
requires_python
licenseApache License Version 2.0
keywords swagger-ui
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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:

.. code-block:: python
  
    from swagger_ui_bundle import swagger_ui_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:

.. code-block:: python

    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:

.. code-block:: python

    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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/bartsanchez/swagger_ui_bundle",
    "name": "swagger-4-ui-bundle",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "swagger-ui",
    "author": "Daniel Grossmann-Kavanagh, Bartolom\u00e9 S\u00e1nchez Salado",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/ed/9f/b3bd0dd56b8cc266e8a37fe155d1c4b69b2ad8eb4790cc41bd759ed47c42/swagger_4_ui_bundle-0.0.4.tar.gz",
    "platform": null,
    "description": "swagger_ui_bundle\n=================\nThis package contains the static files for swagger-ui as a python package.\n\nBasic configuration options are templated with the Jinja2 templating language.\n\nThis package is intended to be webserver-agnostic, so it only includes the\nstatic files, and some very basic configuration.\n\nGetting Started\n===============\nYou can import the swagger_ui_path from the swagger_ui_bundle package like so:\n\n.. code-block:: python\n  \n    from swagger_ui_bundle import swagger_ui_path\n\nYou can easily serve up this directory as all static files to get the default\nswagger-ui distribution. Here's an example in flask:\n\n.. code-block:: python\n\n    from swagger_ui_bundle import swagger_ui_path\n    \n    from flask import Flask, Blueprint, send_from_directory, render_template\n    \n    swagger_bp = Blueprint(\n        'swagger_ui',\n        __name__,\n        static_url_path='',\n        static_folder=swagger_ui_path,\n        template_folder=swagger_ui_path\n    )\n    \n    app = Flask(__name__, static_url_path='')\n    app.register_blueprint(swagger_bp, url_prefix='/ui')\n    \n    if __name__ == \"__main__\":\n        app.run()\n\nYou may wish to override some of the configuration variables. Included\nis a jinaj2 templated file where you can modify these parameters.\nYou can add another route to render this template with your\ndesired configuration like so:\n\n.. code-block:: python\n\n    SWAGGER_UI_CONFIG = {\n        \"openapi_spec_url\": \"https://petstore.swagger.io/v2/swagger.json\"\n    }\n\n    @swagger_bp.route('/')\n    def swagger_ui_index():\n        return render_template('index.j2', **SWAGGER_UI_CONFIG)\n\n\nHave a look at `example.py` for a complete server for the Flask webserver.\n\n\nLicense\n=================\nSince this is just repackaging swagger-ui releases, the license comes from\nthe swagger ui project (https://github.com/swagger-api/swagger-ui).\n\nAll vendored code is published by SmartBear Software under the Apache 2.0\nLicense.\n",
    "bugtrack_url": null,
    "license": "Apache License Version 2.0",
    "summary": "swagger_4_ui_bundle - swagger-ui files in a pip package",
    "version": "0.0.4",
    "split_keywords": [
        "swagger-ui"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "350c8047c1c7a345f3e532404ddae22863bb1d05f779b41913eca8bb7a05624a",
                "md5": "ab9652784dfb6b506690e8916b20c5cf",
                "sha256": "266c6a5b5aa39365cefc84010814c6ce6f1f8e1da3f6722f2f3187185c41e58b"
            },
            "downloads": -1,
            "filename": "swagger_4_ui_bundle-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ab9652784dfb6b506690e8916b20c5cf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 2623089,
            "upload_time": "2023-01-02T21:30:00",
            "upload_time_iso_8601": "2023-01-02T21:30:00.571083Z",
            "url": "https://files.pythonhosted.org/packages/35/0c/8047c1c7a345f3e532404ddae22863bb1d05f779b41913eca8bb7a05624a/swagger_4_ui_bundle-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ed9fb3bd0dd56b8cc266e8a37fe155d1c4b69b2ad8eb4790cc41bd759ed47c42",
                "md5": "e269db4c7afb006f0f7defbbb9fc4983",
                "sha256": "b79447793d02b4d67a66193c83be33b2a0e225fa5cbdad17ce86fb3642a50c25"
            },
            "downloads": -1,
            "filename": "swagger_4_ui_bundle-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "e269db4c7afb006f0f7defbbb9fc4983",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 2595675,
            "upload_time": "2023-01-02T21:30:04",
            "upload_time_iso_8601": "2023-01-02T21:30:04.479416Z",
            "url": "https://files.pythonhosted.org/packages/ed/9f/b3bd0dd56b8cc266e8a37fe155d1c4b69b2ad8eb4790cc41bd759ed47c42/swagger_4_ui_bundle-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-02 21:30:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "bartsanchez",
    "github_project": "swagger_ui_bundle",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "swagger-4-ui-bundle"
}
        
Elapsed time: 0.03577s