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.
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
Release history Release notifications | RSS feed
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)
Built Distributions
Close
Hashes for swagger_ui_py-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3917750bec7edab6aed2c960ef7b06128399a10b2edfa9b33f4c31e5bfae18c |
|
MD5 | 58b3294f5bd5cba19ccaaf5d2b9171e0 |
|
BLAKE2b-256 | b3276fae3c1cfeefea8a0b856854c9d7c291472b7720bf913a3e6186bb6aed87 |
Close
Hashes for swagger_ui_py-0.1.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cb188df224a70af9e443f5f49dc72526cfea662cc2a42dca533533c7241a5ce |
|
MD5 | d57f5da2cf21fb52597cc335a11e4ffb |
|
BLAKE2b-256 | fd7e11667f58ef5cbb0513e282bffa6e8b9d13024850b55a76178f862624cae4 |