Skip to content

sumup/py-sdk-gen

py-sdk-gen

Stars CI Status License Contributor Covenant

py-sdk-gen is a highly opinionated OpenAPI specs to SDK generator for Python.

Quickstart

Install the latest version of py-sdk-gen using

go install github.com/sumup/py-sdk-gen/cmd/py-sdk-gen@latest

And generate your SDK:

py-sdk-gen --mod github.com/me/mypackage --package mypackage --name 'My API' ./openapi.yaml

Overview

py-sdk-gen generates structured SDK that is easy to navigate. Operations are grouped under tags and py-sdk-gen works under the assumption that each operation has one tag and one tag only.

When bootstrapping new project py-sdk-gen will generate all the necessary code for a valid SDK. On following runs it will update only code related to your OpenAPI specs but won't touch the client implementation and other files. This leaves you with the option to customize the client and add other features as necessary. You can opt out of this behavior using the --force flag.

Usage

As a bade minimum, you will need to provide full path of your module (if you are bootstrapping new SDK), package name, and the source OpenAPI specs:

py-sdk-gen generate --mod github.com/me/mypackage --package mypackage --name 'My API' ./openapi.yaml

For further options see

py-sdk-gen help

Maintainers

About

Generate Python SDK from OpenAPI specs.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published