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](https://github.com/swagger-api/swagger-ui).

## Usage

- Install

```bash
pip install swagger-ui-py
```

- Code

```python
# 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/](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.

Source Distribution

swagger-ui-py-0.1.1.tar.gz (2.3 MB view hashes)

Uploaded Source

Built Distributions

swagger_ui_py-0.1.1-py3-none-any.whl (2.3 MB view hashes)

Uploaded Python 3

swagger_ui_py-0.1.1-py2-none-any.whl (2.3 MB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page