guokr / Swagger Py Codegen
a Python web framework generator supports Flask, Tornado, Falcon, Sanic
Stars: ✭ 508
Programming Languages
python
139335 projects - #7 most used programming language
Projects that are alternatives of or similar to Swagger Py Codegen
Flasgger
Easy OpenAPI specs and Swagger UI for your Flask API
Stars: ✭ 2,825 (+456.1%)
Mutual labels: swagger, flask
Safrs
SqlAlchemy Flask-Restful Swagger Json:API OpenAPI
Stars: ✭ 255 (-49.8%)
Mutual labels: swagger, flask
Bhagavadgita
A non-profit initiative to help spread the transcendental wisdom from the Bhagavad Gita to people around the world.
Stars: ✭ 84 (-83.46%)
Mutual labels: swagger, flask
Mentorship Backend
Mentorship System is an application that matches women in tech to mentor each other, on career development, through 1:1 relations during a certain period of time. This is the backend of this system.
Stars: ✭ 132 (-74.02%)
Mutual labels: swagger, flask
python-paginate
Pagination support for python web frameworks (study from will_paginate).
Stars: ✭ 17 (-96.65%)
Mutual labels: sanic, tornado
Tornado Swagger
Swagger API Documentation builder for tornado server.
Stars: ✭ 45 (-91.14%)
Mutual labels: swagger, tornado
Annotated Py Projects
flask/sanic/asyncio/bottle/webpy 大量项目 源码阅读注释合集
Stars: ✭ 308 (-39.37%)
Mutual labels: sanic, flask
Flask Api Starter Kit
Start a Flask API in less than 5 minutes
Stars: ✭ 296 (-41.73%)
Mutual labels: swagger, flask
Flask Restplus Server Example
Real-life RESTful server example on Flask-RESTplus
Stars: ✭ 1,240 (+144.09%)
Mutual labels: swagger, flask
Mini Shop Server
基于 Flask 框架开发的微信小程序后端项目,用于构建小程序商城后台 (电商相关;rbac权限管理;附带自动生成Swagger 风格的API 文档;可作「Python 项目毕设」;慕课网系列)---- 相关博客链接:🌟
Stars: ✭ 446 (-12.2%)
Mutual labels: swagger, flask
Flask Restx
Fork of Flask-RESTPlus: Fully featured framework for fast, easy and documented API development with Flask
Stars: ✭ 1,050 (+106.69%)
Mutual labels: swagger, flask
Flask Restplus
Fully featured framework for fast, easy and documented API development with Flask
Stars: ✭ 2,585 (+408.86%)
Mutual labels: swagger, flask
Docker Flask Mongodb Example
Uses docker compose with a python flask microservice and MongoDB instance to make a sample application
Stars: ✭ 49 (-90.35%)
Mutual labels: swagger, flask
sticker
Sticker is a powerful yet boilerplate-free alternative to writing your web API.
Stars: ✭ 26 (-94.88%)
Mutual labels: sanic, tornado
Apispec
A pluggable API specification generator. Currently supports the OpenAPI Specification (f.k.a. the Swagger specification)..
Stars: ✭ 831 (+63.58%)
Mutual labels: swagger, flask
Sanic Transmute
Easily document your Sanic API with Swagger UI, Plus param validation and model serialization.
Stars: ✭ 42 (-91.73%)
Mutual labels: swagger, sanic
Responder
A familiar HTTP Service Framework for Python.
Stars: ✭ 3,569 (+602.56%)
Mutual labels: flask, falcon
Python RESTful Web Framework Generator
Overview
Swagger Py Codegen is a Python web framework generator, which can help you generate a Python web framework automatically based on a given Swagger Specification doc. Currently, the following languages/frameworks are supported:
Alpha version for now, it may not handle all validation properly. If you found a bug, feel free to contact us.
Install
pip install swagger-py-codegen
Usage
Create all:
swagger_py_codegen --swagger-doc api.yml example-app
Command Options:
-s, --swagger-doc Swagger doc file. [required]
-f, --force Force overwrite.
-p, --package Package name / application name.
-t, --template-dir Path of your custom templates directory.
--spec, --specification Generate online specification json response.
--ui Generate swagger ui.
--validate Validate swagger file.
-tlp, --templates gen flask/tornado/falcon templates, default flask.
--version Show current version.
--help Show this message and exit.
Examples:
Generate example-app from api.yml:
Flask Example
$ swagger_py_codegen -s api.yml example-app -p demo
$ tree (flask-demo)
.
|__ api.yml
|__ example-app
|__ demo
| |__ __init__.py
| |__ v1
| |__ api
| | |__ __init__.py
| | |__ pets.py
| | |__ pets_petId.py
| |__ __init__.py
| |__ routes.py
| |__ schemas.py
| |__ validators.py
|__ requirements.txt
Tornado Example
$ swagger_py_codegen -s api.yml example-app -p demo -tlp=tornado
$ tree (tornado-demo)
.
|__ api.yml
|__ example-app
|__ demo
| |__ __init__.py
| |__ core
| |__ __init.py
| |__ v1
| |__ api
| | |__ __init__.py
| | |__ pets.py
| | |__ pets_petId.py
| |__ __init__.py
| |__ routes.py
| |__ schemas.py
| |__ validators.py
|__ requirements.txt
Falcon Example
$ swagger_py_codegen -s api.yml example-app -p demo -tlp=falcon
$ tree (falcon-demo)
.
|__ api.yml
|__ example-app
|__ demo
| |__ __init__.py
| |__ v1
| |__ api
| | |__ __init__.py
| | |__ pets.py
| | |__ pets_petId.py
| |__ __init__.py
| |__ routes.py
| |__ schemas.py
| |__ validators.py
|__ requirements.txt
Sanic Example
$ swagger_py_codegen -s api.yml example-app -p demo -tlp=sanic
$ tree (sanic-demo)
.
|__ api.yml
|__ example-app
|__ demo
| |__ __init__.py
| |__ v1
| |__ api
| | |__ __init__.py
| | |__ pets.py
| | |__ pets_petId.py
| |__ __init__.py
| |__ routes.py
| |__ schemas.py
| |__ validators.py
|__ requirements.txt
Run Web Server
Install example-app requirements:
$ cd example-app
$ pip install -r requirements.txt
Start example-app:
$ cd demo
$ python __init__.py
And generate example-app-ui from api.yml with ui:
$ swagger_py_codegen -s api.yml example-app-ui -p demo-ui --ui --spec
Then you can visit http://127.0.0.1:5000/static/swagger-ui/index.html in a browser.
OAuth2 Scopes Usage
See the wiki
Compatibility
component | compatibility |
---|---|
OpenAPI Spec | 2.0 |
Python | 2.*, 3.*(Sanic only 3.*) |
Authors
See the AUTHORS.
License
MIT
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].