Skip to main content

Swagger UI for Python web framework, such Tornado, Flask and Sanic.

Project description

swagger-ui-py

Swagger UI for Python web framework, such Tornado, Flask and Sanic.

Swagger UI

Swagger UI version is 3.19.3. see https://github.com/swagger-api/swagger-ui.

Usage

  • Install

    pip install swagger-ui-py
    
  • Code

    # for Tornado
    from swagger_ui import tornado_api_doc
    tornado_api_doc(app, config_path='./conf/test.yaml', url_prefix='/api/doc', title='API doc')
    
    # for Sanic
    from swagger_ui import sanic_api_doc
    sanic_api_doc(app, config_path='./conf/test.yaml', url_prefix='/api/doc', title='API doc')
    
    # for Flask
    from swagger_ui import flask_api_doc
    flask_api_doc(app, config_path='./conf/test.yaml', url_prefix='/api/doc', title='API doc')
    
  • Edit Swagger config file (JSON or YAML)

    Please see https://swagger.io/resources/open-api/.

  • Access

    http://<host>:<port>/api/doc, open the url in your browser.

Project details


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
swagger_ui_py-0.1.3-py2-none-any.whl (2.3 MB) Copy SHA256 hash SHA256 Wheel py2
swagger_ui_py-0.1.3-py3-none-any.whl (2.3 MB) Copy SHA256 hash SHA256 Wheel py3

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page