openapiart - OpenAPI Artifact Generator
The OpenAPIArt (OpenAPI Artifact Generator) python package does the following:
- pre-processes OpenAPI yaml files according to the MODELGUIDE
- using the path keyword bundles all dependency OpenAPI yaml files into a single openapi.yaml file
- post-processes any MODELGUIDE extensions
- validates the bundled openapi.yaml file
- generates a
.protofile from the openapi file - optionally generates a static redocly documentation file
- optionally generates a
python ux sdkfrom the openapi file - optionally generates a
go ux sdkfrom the openapi file
Getting started
Install the package
pip install openapiart
Generate artifacts from OpenAPI files
"""
The following command will produce these artifacts:
- ./artifacts/openapi.yaml
- ./artifacts/openapi.json
- ./artifacts/openapi.html
- ./artifacts/sample.proto
- ./artifacts/sample/__init__.py
- ./artifacts/sample/sample.py
- ./artifacts/sample/sample_pb2.py
- ./artifacts/sample/sample_pb2_grpc.py
- ./pkg/openapiart.go
- ./pkg/go.mod
- ./pkg/go.sum
- ./pkg/sanity/sanity_grpc.pb.go
- ./pkg/sanity/sanity.pb.go
"""
import openapiart
# bundle api files
# validate the bundled file
# generate the documentation file
art = openapiart.OpenApiArt(
api_files=[
"./openapiart/tests/api/info.yaml",
"./openapiart/tests/common/common.yaml",
"./openapiart/tests/api/api.yaml",
],
artifact_dir="./artifacts",
protobuf_name="sanity",
extension_prefix="sanity",
)
# optionally generate a python ux sdk and python protobuf/grpc stubs
art.GeneratePythonSdk(
package_name="sanity"
)
# optionally generate a go ux sdk and go protobuf/grpc stubs
art.GenerateGoSdk(
package_dir="github.com/open-traffic-generator/openapiart/pkg",
package_name="openapiart"
)
Specifications
This repository is based on the OpenAPI specification which is a standard, language-agnostic interface to RESTful APIs.
Metadata
Release files for openapiart 0.3.43
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| openapiart-0.3.43.tar.gz | 126.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openapiart-0.3.43-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 287.5 kB
Release files / openapiart-0.3.43.tar.gz
| Download URL | openapiart-0.3.43.tar.gz |
|---|---|
| Size | 126.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bfadcef29dbeef01aed8903c15ea2800880f046f701549cef35b152480dc3f42
|
|
BLAKE2b-256 checksum How to use checksums |
dc15d104c16441f3a7e993f49370cf3514f679438e8a58bed6618c97235c2dee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / openapiart-0.3.43-py3-none-any.whl
| Download URL | openapiart-0.3.43-py3-none-any.whl |
|---|---|
| Size | 161.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e3bd2ab902193d6aef3bc8df76acafcc06b82d00fbe3c7f4960d960d8aa8ea05
|
|
BLAKE2b-256 checksum How to use checksums |
1fc2ecc7e0251a2c8accab09c70f2dd35e99b7244d98fc2c7c1604f04a9eef25
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|