Skip to content

Commit 789e8cb

Browse files
authored
Merge pull request #89 from guokr/update_readme
update README.md
2 parents 9d6b065 + 589a22d commit 789e8cb

File tree

1 file changed

+36
-13
lines changed

1 file changed

+36
-13
lines changed

README.md

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
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.
87

9-
**Alpha version for now, it can not handle all validation properly.**
8+
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:
9+
10+
11+
* [Flask](http://flask.pocoo.org/) (Python)
12+
* [Tornado](http://www.tornadoweb.org/en/stable/) (Python)
13+
* [Falcon](https://falconframework.org/) (Python)
14+
15+
16+
**Alpha version for now, it may not handle all validation properly. If you found a bug, feel free to contact us.**
1017

1118

1219
## Install
@@ -25,7 +32,7 @@ swagger_py_codegen --swagger-doc api.yml example-app
2532

2633
Command Options:
2734

28-
-s, --swagger, --swagger-doc Swagger doc file. [required]
35+
-s, --swagger, --swagger-doc Swagger doc file. [required]
2936
-f, --force Force overwrite.
3037
-p, --package Package name / application name.
3138
-t, --template-dir Path of your custom templates directory.
@@ -38,13 +45,15 @@ Command Options:
3845

3946
## Examples:
4047

41-
Generate example-app from [apis.yml](https://github.com/guokr/swagger-py-codegen/blob/master/api.yml "Title"):
48+
Generate example-app from [api.yml](https://github.com/guokr/swagger-py-codegen/blob/master/api.yml "Title"):
49+
50+
#### Flask Example
4251

4352
$tree
4453
.
4554
|__ api.yml
4655

47-
$ swagger_py_codegen -s api.yml example-app -p demo
56+
$ swagger_py_codegen -s api.yml example-app -p demo
4857
$ tree (flask-demo)
4958
.
5059
|__ api.yml
@@ -65,7 +74,9 @@ Generate example-app from [apis.yml](https://github.com/guokr/swagger-py-codegen
6574
| |__ validators.py
6675
|__ requirements.txt
6776

68-
$ swagger_py_codegen -s api.yml example-app -p demo -tlp=tornado
77+
#### Tornado Example
78+
79+
$ swagger_py_codegen -s api.yml example-app -p demo -tlp=tornado
6980
$ tree (tornado-demo)
7081
.
7182
|__ api.yml
@@ -88,7 +99,9 @@ Generate example-app from [apis.yml](https://github.com/guokr/swagger-py-codegen
8899
| |__ validators.py
89100
|__ requirements.txt
90101

91-
$ swagger_py_codegen -s api.yml example-app -p demo -tlp=falcon
102+
#### Falcon Example
103+
104+
$ swagger_py_codegen -s api.yml example-app -p demo -tlp=falcon
92105
$ tree (falcon-demo)
93106
.
94107
|__ api.yml
@@ -109,6 +122,7 @@ Generate example-app from [apis.yml](https://github.com/guokr/swagger-py-codegen
109122
| |__ validators.py
110123
|__ requirements.txt
111124

125+
#### Run Web Server
112126

113127
Install example-app requirements:
114128

@@ -120,19 +134,28 @@ Start example-app:
120134
$ cd demo
121135
$ python __init__.py
122136

123-
And generate example-app-ui from apis.yml with ui:
137+
And generate example-app-ui from api.yml with ui:
124138

125-
$ swagger_py_codegen -s api.yml example-app-ui -p demo-ui --ui --spec
139+
$ swagger_py_codegen -s api.yml example-app-ui -p demo-ui --ui --spec
140+
141+
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.
142+
143+
144+
## Compatibility
145+
146+
|component|compatibility|
147+
|-----|-----|
148+
|OpenAPI Spec|2.0|
149+
|Python|2.\*, 3.\*|
126150

127-
Then you can visit http://127.0.0.1:5000/static/swagger-ui/index.html in a browser.
128151

129152
## Authors
130-
--------
153+
131154
See the [AUTHORS](https://github.com/guokr/swagger-py-codegen/blob/master/AUTHORS "Title").
132155

133156

134157
## License
135-
--------
158+
136159
MIT
137160

138161
[travis-url]: https://travis-ci.org/guokr/swagger-py-codegen

0 commit comments

Comments
 (0)