Swagger codegen for Python
Installation
pip install swagger-codegen
Usage example
# Generate Petstore Api client using 'petstore' package name.
swagger_codegen generate http://petstore.swagger.io:8080/api/v3/openapi.json petstore
python
Python 3.8.1 (default, Jan 23 2020, 13:58:52)
[Clang 11.0.0 (clang-1100.0.33.16)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from petstore import new_client, Configuration
>>> from swagger_codegen.api.adapter.requests import RequestsAdapter
>>> from petstore.apis.user.createUser import User
>>> client = new_client(RequestsAdapter(), Configuration(host="http://petstore.swagger.io:8080"))
>>> print(client.user.createUser(User(id=1, username="Swagger-Codegen")))
id=1 username='Swagger-Codegen' firstName=None lastName=None email=None password=None phone=None userStatus=0
You can see example source code for PetStore Api in example directory of a project.
Work in progress
Though library gives nice results for generated API, it is still in development. Some tests are missing. API is a subject to change until stable release.
Anyway backward compatibility will be kept as most as possible.
Metadata
Release files for swagger-codegen 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| swagger-codegen-0.1.3.tar.gz | 14.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| swagger_codegen-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.0 kB
Release files / swagger-codegen-0.1.3.tar.gz
| Download URL | swagger-codegen-0.1.3.tar.gz |
|---|---|
| Size | 14.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0f1245b6523076dd09f394ae40d551933e619a56100b5b23e0ae2e279daf64b7
|
|
BLAKE2b-256 checksum How to use checksums |
f4146ef771c4b328c051aa12ff25b34d6bb6e5e7cda63e98d2ff44948e6973e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.5 CPython/3.8.1 Darwin/19.4.0
|
Release files / swagger_codegen-0.1.3-py3-none-any.whl
| Download URL | swagger_codegen-0.1.3-py3-none-any.whl |
|---|---|
| Size | 23.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
da7f2b7f46c0979f73b686c4173e36ca95f806a0b91915062287094658c58aca
|
|
BLAKE2b-256 checksum How to use checksums |
309c32404b8aae59a0752ad003feb0c05b5d6bc52bd7dd0e0035aa2ecbc06f5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.5 CPython/3.8.1 Darwin/19.4.0
|