{"id":13501522,"url":"https://github.com/guokr/swagger-py-codegen","last_synced_at":"2025-05-16T04:04:40.270Z","repository":{"id":52207167,"uuid":"35595756","full_name":"guokr/swagger-py-codegen","owner":"guokr","description":"a Python web framework generator supports Flask, Tornado, Falcon, Sanic","archived":false,"fork":false,"pushed_at":"2022-01-25T08:54:43.000Z","size":6405,"stargazers_count":554,"open_issues_count":23,"forks_count":153,"subscribers_count":41,"default_branch":"master","last_synced_at":"2025-05-10T11:17:01.946Z","etag":null,"topics":["falcon","flask","pypi","python","sanic","swagger","swagger-codegen","tornado"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guokr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-14T06:45:46.000Z","updated_at":"2025-04-29T13:59:30.000Z","dependencies_parsed_at":"2022-09-19T10:10:25.388Z","dependency_job_id":null,"html_url":"https://github.com/guokr/swagger-py-codegen","commit_stats":null,"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guokr%2Fswagger-py-codegen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guokr%2Fswagger-py-codegen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guokr%2Fswagger-py-codegen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guokr%2Fswagger-py-codegen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guokr","download_url":"https://codeload.github.com/guokr/swagger-py-codegen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254464894,"owners_count":22075570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["falcon","flask","pypi","python","sanic","swagger","swagger-codegen","tornado"],"created_at":"2024-07-31T22:01:40.378Z","updated_at":"2025-05-16T04:04:36.893Z","avatar_url":"https://github.com/guokr.png","language":"Python","readme":"# Python RESTful Web Framework Generator\n\n[![Build Status][travis-image]][travis-url] [![PyPi Version][pypi-image]][pypi-url]\n\n## Overview\n\n\nSwagger 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:\n\n\n* [Flask](http://flask.pocoo.org/) (Python)\n* [Tornado](http://www.tornadoweb.org/en/stable/) (Python)\n* [Falcon](https://falconframework.org/) (Python)\n* [Sanic](https://github.com/channelcat/sanic) (Python)\n\n\n**Alpha version for now, it may not handle all validation properly. If you found a bug, feel free to contact us.**\n\n\n## Install\n\n```\npip install swagger-py-codegen\n```\n\n## Usage\n\nCreate all:\n\n```\nswagger_py_codegen --swagger-doc api.yml example-app\n```\n\nCommand Options:\n\n\t-s, --swagger-doc               Swagger doc file.  [required]\n\t-f, --force                     Force overwrite.\n\t-p, --package                   Package name / application name.\n\t-t, --template-dir              Path of your custom templates directory.\n\t--spec, --specification         Generate online specification json response.\n\t--ui                            Generate swagger ui.\n\t--validate                      Validate swagger file.\n\t-tlp, --templates               gen flask/tornado/falcon templates, default flask.\n\t--version                       Show current version.\n\t--help                          Show this message and exit.\n\n## Examples:\n\nGenerate example-app from [api.yml](https://github.com/guokr/swagger-py-codegen/blob/master/api.yml \"Title\"):\n\n#### Flask Example\n\n    $ swagger_py_codegen -s api.yml example-app -p demo\n    $ tree (flask-demo)\n\t.\n\t|__ api.yml\n\t|__ example-app\n\t   |__ demo\n\t   |  |__ __init__.py\n\t   |  |__ v1\n\t   |     |__ api\n\t   |     |  |__ __init__.py\n\t   |     |  |__ pets.py\n\t   |     |  |__ pets_petId.py\n\t   |     |__ __init__.py\n\t   |     |__ routes.py\n\t   |     |__ schemas.py\n\t   |     |__ validators.py\n\t   |__ requirements.txt\n\n#### Tornado Example\n\n\t$ swagger_py_codegen -s api.yml example-app -p demo -tlp=tornado\n    $ tree (tornado-demo)\n\t.\n\t|__ api.yml\n\t|__ example-app\n\t   |__ demo\n\t   |  |__ __init__.py\n\t   |  |__ core\n\t   |     |__ __init.py\n\t   |  |__ v1\n\t   |     |__ api\n\t   |     |  |__ __init__.py\n\t   |     |  |__ pets.py\n\t   |     |  |__ pets_petId.py\n\t   |     |__ __init__.py\n\t   |     |__ routes.py\n\t   |     |__ schemas.py\n\t   |     |__ validators.py\n\t   |__ requirements.txt\n\n#### Falcon Example\n\n    $ swagger_py_codegen -s api.yml example-app -p demo -tlp=falcon\n    $ tree (falcon-demo)\n\t.\n\t|__ api.yml\n\t|__ example-app\n\t   |__ demo\n\t   |  |__ __init__.py\n\t   |  |__ v1\n\t   |     |__ api\n\t   |     |  |__ __init__.py\n\t   |     |  |__ pets.py\n\t   |     |  |__ pets_petId.py\n\t   |     |__ __init__.py\n\t   |     |__ routes.py\n\t   |     |__ schemas.py\n\t   |     |__ validators.py\n\t   |__ requirements.txt\n\n\n#### Sanic Example\n\n    $ swagger_py_codegen -s api.yml example-app -p demo -tlp=sanic\n    $ tree (sanic-demo)\n\t.\n\t|__ api.yml\n\t|__ example-app\n\t   |__ demo\n\t   |  |__ __init__.py\n\t   |  |__ v1\n\t   |     |__ api\n\t   |     |  |__ __init__.py\n\t   |     |  |__ pets.py\n\t   |     |  |__ pets_petId.py\n\t   |     |__ __init__.py\n\t   |     |__ routes.py\n\t   |     |__ schemas.py\n\t   |     |__ validators.py\n\t   |__ requirements.txt\n\n\n#### Run Web Server\n\nInstall example-app requirements:\n\n    $ cd example-app\n    $ pip install -r requirements.txt\n\nStart example-app:\n\n    $ cd demo\n    $ python __init__.py\n\nAnd generate example-app-ui from api.yml with ui:\n\n    $ swagger_py_codegen -s api.yml  example-app-ui -p demo-ui --ui --spec\n\nThen 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.\n\n\n#### OAuth2 Scopes Usage\n\nSee the [wiki](https://github.com/guokr/swagger-py-codegen/wiki/OAuth2-Scopes-Usage)\n\n\n## Compatibility\n\n|component|compatibility|\n|-----|-----|\n|OpenAPI Spec|2.0|\n|Python|2.\\*, 3.\\*(Sanic only 3.\\*)|\n\n\n## Authors\n\nSee the [AUTHORS](https://github.com/guokr/swagger-py-codegen/blob/master/AUTHORS \"Title\").\n\n\n## License\n\nMIT\n\n[travis-url]: https://travis-ci.org/guokr/swagger-py-codegen\n[travis-image]: https://travis-ci.org/guokr/swagger-py-codegen.svg\n\n[pypi-url]: https://pypi.python.org/pypi/swagger-py-codegen/\n[pypi-image]: https://img.shields.io/pypi/v/swagger-py-codegen.svg?style=flat-square\n","funding_links":[],"categories":["Python","Resources"],"sub_categories":["Built with Sanic"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguokr%2Fswagger-py-codegen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguokr%2Fswagger-py-codegen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguokr%2Fswagger-py-codegen/lists"}