Swagger UI for Python web framework, such Tornado, Flask, Quart and Sanic.
Project description
# swagger-ui-py
Swagger UI for Python web framework, such Tornado, Flask, Quart, aiohttp and Sanic.
## 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')
# for Quart
from swagger_ui import quart_api_doc
quart_api_doc(app, config_path='./conf/test.yaml', url_prefix='/api/doc', title='API doc')
# for aiohttp
from swagger_ui import aiohttp_api_doc
aiohttp_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
Swagger UI version is `3.19.3`. see [https://github.com/swagger-api/swagger-ui](https://github.com/swagger-api/swagger-ui).
Swagger UI for Python web framework, such Tornado, Flask, Quart, aiohttp and Sanic.
## 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')
# for Quart
from swagger_ui import quart_api_doc
quart_api_doc(app, config_path='./conf/test.yaml', url_prefix='/api/doc', title='API doc')
# for aiohttp
from swagger_ui import aiohttp_api_doc
aiohttp_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
Swagger UI version is `3.19.3`. see [https://github.com/swagger-api/swagger-ui](https://github.com/swagger-api/swagger-ui).
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
Built Distributions
Close
Hashes for swagger-ui-py-0.1.5.linux-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a00f25983e1270a1e7a12b92e34b1fdb1ebacf988de73182fe070c1dc98ee671 |
|
MD5 | e62c80d902af481f6e80744c316c3821 |
|
BLAKE2b-256 | 9709f5e17112e185abc2d5fe346ee74dcba6c6cbe10bc0aa24f121d5330ff406 |
Close
Hashes for swagger_ui_py-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87fe9041e2d6bee853d07988de2ff82be2d58444f44b6ec7b8e7b0dfefeffdde |
|
MD5 | 9a403d6f3ac19069dc9583c9185ccbca |
|
BLAKE2b-256 | 3463c2712394a96f60a24ef98e0f0047e05572a6eeed0908fd40394941261b22 |
Close
Hashes for swagger_ui_py-0.1.5-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a00bd3221771bad4f3510de4b6b164de084715401c61c850741f74c828f887b5 |
|
MD5 | d111e07495d05e08b557222f5a7a0c8b |
|
BLAKE2b-256 | d48fccba61fbd44f18d7803784ffa2db7ce9371a28bfc89a169a88e30a9e2666 |