Skip to main content

Code CI Test Coverage Latest PyPI version Apache License

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.

Release files for setuptools-openapi-generator 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for setuptools-openapi-generator 0.1.1
File Size Uploaded
setuptools_openapi_generator-0.1.1.tar.gz 22.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for setuptools-openapi-generator 0.1.1
File Interpreter ABI Platform
setuptools_openapi_generator-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 36.3 kB

Release files / setuptools_openapi_generator-0.1.1.tar.gz

Download URL setuptools_openapi_generator-0.1.1.tar.gz
Size 22.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5ace9a3e245c3666b7d33348febf63434ede6379093ab7ef09fb7babd7b4cbbc
BLAKE2b-256 checksum
How to use checksums
d301e49b4d4f7349887e93847e3087d0adf1bbb8b01c495306b1b20106a15051
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / setuptools_openapi_generator-0.1.1-py3-none-any.whl

Download URL setuptools_openapi_generator-0.1.1-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a11f2932f591c50a2d6a93fc39463e4fe460c1782daea16ca7926d1c62e0711c
BLAKE2b-256 checksum
How to use checksums
c3e744a10f2936efcd0ff7c9a5063a620c9075237f353fa86e39ed17d621d829
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page