Generate a Python SDK by following the instructions on this page.
Initialize the fern folder with your existing OpenAPI specification. Specify your organization name using the --organization flag.
OpenAPI accepts both JSON and YAML formats.
This creates a fern folder in your current directory.
Check that your API definition is valid, and fix errors before proceeding:
Run the following command to add the Python SDK generator to generators.yml:
This command adds the following group to generators.yml:
Run the following command to generate your SDK:
If you have multiple APIs, use the --api flag to specify the API you want to generate:
This creates a sdks folder in your current directory. The resulting folder structure looks like this:
Fern uses a multi-repo structure: your source repository contains the fern/ folder, and each SDK gets its own separate repository.
fern/ folder if you don’t have one already (e.g., your-org/your-api-definitions).your-org/your-api-python-sdk).Follow the Publishing to PyPI guide to configure your package and set up automated publishing via GitHub Actions.