Swagger to Python SDK

Welcome!

Application

This application converts Swagger / OpenAPI JSON files into a ready-to-use Python class. Conversion is performed by a Go backend (see main.go) — upload your JSON file and the generated .py will download automatically.


No Input :(

Thank you for checking out my Swagger file to a Python class converter application. This application will turn various REST API definitions into easily executable python code. Facilitating application generation for client side developers and REST API destributors. It does this by utilizing the standardized method of describing REST based APIs to extract the details of the parameters of the endpoint to create a function that is then implemented as part of a class. This class definition will contain functions for each executable endpoint for the api. It is able to implement a server selection initialization function for the class if the API utilizes multiple server domains. It currently is only able to implement basic authentication using the authorization header for authenticating with the APIs.

Specifications

Types

Type specified in Swagger file
Type converted into Python
String
str
number,integer,int
int
object
bool

Formats

Format specified in Swagger file
Regular expression used to parse valid inputs in python
uuid
^[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}
date
^[0-9]{4}-[0-9]{2}-[0-9]{2}
date-time
^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}Z
ipv4
"(?:[0-9]{1,3}\.){3}[0-9]{1,3}

Code

The code is hosted on github. Check out the repository >here<