Skip to main content

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swagger-codegen-0.1.10.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

swagger_codegen-0.1.10-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file swagger-codegen-0.1.10.tar.gz.

File metadata

  • Download URL: swagger-codegen-0.1.10.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.1 Darwin/19.4.0

File hashes

Hashes for swagger-codegen-0.1.10.tar.gz
Algorithm Hash digest
SHA256 7d8f5d82efcd01ab2c510c58839d77984739a83c3415fe59d7d98424e07a8005
MD5 2dd714706feb1b7bedad635a0bdec3f0
BLAKE2b-256 f5fff083fe69e5b11fe83a76393732aeefc53b27bed7a2dda7d68d8f44b53942

See more details on using hashes here.

File details

Details for the file swagger_codegen-0.1.10-py3-none-any.whl.

File metadata

  • Download URL: swagger_codegen-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.1 Darwin/19.4.0

File hashes

Hashes for swagger_codegen-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 c85b3509c86576cdb2c0ad9bd59e7a7ae90f81e2a57a6399aa5ea3116864dc87
MD5 904de19eb4cda42680ab23c9220fcdf6
BLAKE2b-256 7a28d776e4378b3739a9e637e13b0ad82af0ba9455601dd9fc642821a0872a18

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.31

2 files

0.1.30

2 files

0.1.29

2 files

0.1.28

2 files

0.1.27

2 files

0.1.26

2 files

0.1.25

2 files

0.1.24

2 files

0.1.23

2 files

0.1.22

2 files

0.1.21

2 files

0.1.20

2 files

0.1.19

2 files

0.1.18

2 files

0.1.17

2 files

0.1.16

2 files

0.1.15

2 files

0.1.14

2 files

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

This release

0.1.10 This release

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page