1- # Flask/Tornado/Falcon RESTful Application Code Generator
1+ # RESTful Web Framework Generator
22
33[ ![ Build Status] [ travis-image ]] [ travis-url ] [ ![ PyPi Version] [ pypi-image ]] [ pypi-url ]
44
55## Overview
66
7- Generate Flask/Tornado/Falcon-RESTful application code from a Swagger Specification doc.
7+
8+ This is a swagger codegen project for Python web framework, which allows generation of RESTful application code automatically given a Swagger Specification doc. Currently, the following languages/frameworks are supported:
9+
10+ * [ Flask] ( http://flask.pocoo.org/ ) (Python)
11+ * [ Tornado] ( http://www.tornadoweb.org/en/stable/ ) (Python)
12+ * [ Falcon] ( https://falconframework.org/ ) (Python)
13+
814
915** Alpha version for now, it can not handle all validation properly.**
1016
@@ -25,7 +31,7 @@ swagger_py_codegen --swagger-doc api.yml example-app
2531
2632Command Options:
2733
28- -s, --swagger, --swagger-doc Swagger doc file. [required]
34+ -s, --swagger, --swagger-doc Swagger doc file. [required]
2935 -f, --force Force overwrite.
3036 -p, --package Package name / application name.
3137 -t, --template-dir Path of your custom templates directory.
@@ -38,13 +44,15 @@ Command Options:
3844
3945## Examples:
4046
41- Generate example-app from [ apis.yml] ( https://github.com/guokr/swagger-py-codegen/blob/master/api.yml " Title ") :
47+ Generate example-app from [ api.yml] ( https://github.com/guokr/swagger-py-codegen/blob/master/api.yml " Title ") :
48+
49+ #### Flask Example
4250
4351 $tree
4452 .
4553 |__ api.yml
4654
47- $ swagger_py_codegen -s api.yml example-app -p demo
55+ $ swagger_py_codegen -s api.yml example-app -p demo
4856 $ tree (flask-demo)
4957 .
5058 |__ api.yml
@@ -65,7 +73,9 @@ Generate example-app from [apis.yml](https://github.com/guokr/swagger-py-codegen
6573 | |__ validators.py
6674 |__ requirements.txt
6775
68- $ swagger_py_codegen -s api.yml example-app -p demo -tlp=tornado
76+ #### Tornado Example
77+
78+ $ swagger_py_codegen -s api.yml example-app -p demo -tlp=tornado
6979 $ tree (tornado-demo)
7080 .
7181 |__ api.yml
@@ -88,7 +98,9 @@ Generate example-app from [apis.yml](https://github.com/guokr/swagger-py-codegen
8898 | |__ validators.py
8999 |__ requirements.txt
90100
91- $ swagger_py_codegen -s api.yml example-app -p demo -tlp=falcon
101+ #### Falcon Example
102+
103+ $ swagger_py_codegen -s api.yml example-app -p demo -tlp=falcon
92104 $ tree (falcon-demo)
93105 .
94106 |__ api.yml
@@ -109,6 +121,7 @@ Generate example-app from [apis.yml](https://github.com/guokr/swagger-py-codegen
109121 | |__ validators.py
110122 |__ requirements.txt
111123
124+ #### Run Web Server
112125
113126Install example-app requirements:
114127
@@ -120,19 +133,28 @@ Start example-app:
120133 $ cd demo
121134 $ python __init__.py
122135
123- And generate example-app-ui from apis .yml with ui:
136+ And generate example-app-ui from api .yml with ui:
124137
125- $ swagger_py_codegen -s api.yml example-app-ui -p demo-ui --ui --spec
138+ $ swagger_py_codegen -s api.yml example-app-ui -p demo-ui --ui --spec
139+
140+ Then you can visit [ http://127.0.0.1:5000/static/swagger-ui/index.html ] ( http://127.0.0.1:5000/static/swagger-ui/index.html ) in a browser.
141+
142+
143+ ## Compatibility
144+
145+ | component| compatibility|
146+ | -----| -----|
147+ | OpenAPI Spec| 2.0|
148+ | Python| 2.\* , 3.\* |
126149
127- Then you can visit http://127.0.0.1:5000/static/swagger-ui/index.html in a browser.
128150
129151## Authors
130- --------
152+
131153See the [ AUTHORS] ( https://github.com/guokr/swagger-py-codegen/blob/master/AUTHORS " Title ") .
132154
133155
134156## License
135- --------
157+
136158MIT
137159
138160[ travis-url ] : https://travis-ci.org/guokr/swagger-py-codegen
0 commit comments