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 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')
# 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')
```
- 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, Quart 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')
# 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')
```
- 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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
Close
Hashes for swagger_ui_py-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb45ceb4185d415f27bc6346a37ca2461309cb0105f76fd4b63197a4da74bbab |
|
MD5 | 6c997cfba78a16e37e924de3869ffcfd |
|
BLAKE2b-256 | 32e6352b5c7d6036eb943062c7cd26bab5973c7e5f4ad62f0217f057b26c457d |
Close
Hashes for swagger_ui_py-0.1.4-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2db5fc607f0dc8bdb998d5714fa93efc9a490b8d77a97472370e30d182d167ca |
|
MD5 | e302b208ebfe9bebf95e704be58e4d1f |
|
BLAKE2b-256 | 83f321ba269585794cae2c0e027e863c802c0fd87787649fd60fbd7e8fda30cf |