A setuptools extension for generating OpenAPI clients
Project description
A setuptools extension for generating RESTful clients from OpenAPI schema at build time, allowing for easy use of the API with static type checking.
PyPI |
pip install setuptools_openapi_generator |
Source code |
https://github.com/DiamondLightSource/setuptools_openapi_generator |
Releases |
https://github.com/DiamondLightSource/setuptools_openapi_generator/releases |
To generate an API client in your project, simply add setuptools_openapi_generator
to the build-system.requires
section of your pyproject.toml
.
Client generation can be configured via a tool
entry in the pyproject.toml
as below:
[build-system]
requires = ["setuptools", "setuptools_openapi_generator"]
[tool.setuptools_openapi_generator]
basedir = "src/sample_project/apis/"
sources = [
"https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/link-example.json",
"api_definitions/petstore.json"
]
The above example will generate two API clients, at src/sample_project/apis/link_example
and src/sample_project/apis/petstore
respectively.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for setuptools_openapi_generator-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ace9a3e245c3666b7d33348febf63434ede6379093ab7ef09fb7babd7b4cbbc |
|
MD5 | 893d05a8f3e6ebf6e6b92cb3dddf6f40 |
|
BLAKE2b-256 | d301e49b4d4f7349887e93847e3087d0adf1bbb8b01c495306b1b20106a15051 |
Hashes for setuptools_openapi_generator-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a11f2932f591c50a2d6a93fc39463e4fe460c1782daea16ca7926d1c62e0711c |
|
MD5 | 49e62bfff56a675185a393c87e37c369 |
|
BLAKE2b-256 | c3e744a10f2936efcd0ff7c9a5063a620c9075237f353fa86e39ed17d621d829 |