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
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.
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