# openapiart - OpenAPI Artifact Generator
[](https://github.com/open-traffic-generator/openapiart/actions)
[](https://www.repostatus.org/#active)
[](https://pypi.python.org/pypi/openapiart)
[](https://en.wikipedia.org/wiki/MIT_License)
The `OpenAPIArt` (OpenAPI Artifact Generator) python package does the following:
- pre-processes OpenAPI yaml files according to the [MODELGUIDE](../main/MODELGUIDE.md)
- using the path keyword bundles all dependency OpenAPI yaml files into a single openapi.yaml file
- post-processes any [MODELGUIDE](../main/MODELGUIDE.md) extensions
- validates the bundled openapi.yaml file
- generates a `.proto` file from the openapi file
- optionally generates a static redocly documentation file
- optionally generates a `python ux sdk` from the openapi file
- optionally generates a `go ux sdk` from the openapi file
## Getting started
Install the package
```
pip install openapiart
```
Generate artifacts from OpenAPI files
```python
"""
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](
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md)
which is a standard, language-agnostic interface to RESTful APIs.
> [Modeling guide specific to this package](../main/MODELGUIDE.md)
Raw data
{
"_id": null,
"home_page": "https://github.com/open-traffic-generator/openapiart",
"name": "openapiart",
"maintainer": null,
"docs_url": null,
"requires_python": "<4,>=2.7",
"maintainer_email": null,
"keywords": "testing openapi artifact generator",
"author": "https://github.com/open-traffic-generator/openapiart",
"author_email": "andy.balogh@keysight.com",
"download_url": "https://files.pythonhosted.org/packages/10/57/e9258cabcccedcd8c82b63a9feb898dae75aff87a75c8abb008e10f229d5/openapiart-0.3.29.tar.gz",
"platform": null,
"description": "# openapiart - OpenAPI Artifact Generator\n\n[](https://github.com/open-traffic-generator/openapiart/actions)\n[](https://www.repostatus.org/#active)\n[](https://pypi.python.org/pypi/openapiart)\n[](https://en.wikipedia.org/wiki/MIT_License)\n\nThe `OpenAPIArt` (OpenAPI Artifact Generator) python package does the following:\n- pre-processes OpenAPI yaml files according to the [MODELGUIDE](../main/MODELGUIDE.md)\n- using the path keyword bundles all dependency OpenAPI yaml files into a single openapi.yaml file\n- post-processes any [MODELGUIDE](../main/MODELGUIDE.md) extensions\n- validates the bundled openapi.yaml file\n- generates a `.proto` file from the openapi file\n- optionally generates a static redocly documentation file \n- optionally generates a `python ux sdk` from the openapi file\n- optionally generates a `go ux sdk` from the openapi file\n\n## Getting started\nInstall the package\n```\npip install openapiart\n```\n\nGenerate artifacts from OpenAPI files\n```python\n\"\"\" \nThe following command will produce these artifacts:\n - ./artifacts/openapi.yaml\n - ./artifacts/openapi.json\n - ./artifacts/openapi.html\n - ./artifacts/sample.proto\n - ./artifacts/sample/__init__.py\n - ./artifacts/sample/sample.py\n - ./artifacts/sample/sample_pb2.py\n - ./artifacts/sample/sample_pb2_grpc.py\n - ./pkg/openapiart.go\n - ./pkg/go.mod\n - ./pkg/go.sum\n - ./pkg/sanity/sanity_grpc.pb.go\n - ./pkg/sanity/sanity.pb.go\n\"\"\"\nimport openapiart\n\n# bundle api files\n# validate the bundled file\n# generate the documentation file\nart = openapiart.OpenApiArt(\n api_files=[\n \"./openapiart/tests/api/info.yaml\",\n \"./openapiart/tests/common/common.yaml\",\n \"./openapiart/tests/api/api.yaml\",\n ],\n artifact_dir=\"./artifacts\",\n protobuf_name=\"sanity\",\n extension_prefix=\"sanity\",\n)\n\n# optionally generate a python ux sdk and python protobuf/grpc stubs\nart.GeneratePythonSdk(\n package_name=\"sanity\"\n)\n\n# optionally generate a go ux sdk and go protobuf/grpc stubs\nart.GenerateGoSdk(\n package_dir=\"github.com/open-traffic-generator/openapiart/pkg\", \n package_name=\"openapiart\"\n)\n```\n\n## Specifications\n> This repository is based on the [OpenAPI specification](\nhttps://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md) \nwhich is a standard, language-agnostic interface to RESTful APIs. \n\n> [Modeling guide specific to this package](../main/MODELGUIDE.md)\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "The OpenAPI Artifact Generator Python Package",
"version": "0.3.29",
"project_urls": {
"Homepage": "https://github.com/open-traffic-generator/openapiart"
},
"split_keywords": [
"testing",
"openapi",
"artifact",
"generator"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "cbd684a7647cdd17554737c3d3fcd7571c80e3ab2b2589a69c237ac47361daf7",
"md5": "11c7ade70d36bb8bc9bb2e3197c30adb",
"sha256": "9347624d3e7460bb2ba5eda88aa95dbf641588ecfd20f5d8baa2a5dc4b399cd3"
},
"downloads": -1,
"filename": "openapiart-0.3.29-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "11c7ade70d36bb8bc9bb2e3197c30adb",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": "<4,>=2.7",
"size": 153252,
"upload_time": "2025-07-28T13:40:52",
"upload_time_iso_8601": "2025-07-28T13:40:52.359872Z",
"url": "https://files.pythonhosted.org/packages/cb/d6/84a7647cdd17554737c3d3fcd7571c80e3ab2b2589a69c237ac47361daf7/openapiart-0.3.29-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "1057e9258cabcccedcd8c82b63a9feb898dae75aff87a75c8abb008e10f229d5",
"md5": "144545039cff31d0062d8b107e763ad4",
"sha256": "093f86201f7550c54ba139cab488188561b47518fa01005be3ed39f49217c565"
},
"downloads": -1,
"filename": "openapiart-0.3.29.tar.gz",
"has_sig": false,
"md5_digest": "144545039cff31d0062d8b107e763ad4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4,>=2.7",
"size": 120807,
"upload_time": "2025-07-28T13:40:53",
"upload_time_iso_8601": "2025-07-28T13:40:53.711937Z",
"url": "https://files.pythonhosted.org/packages/10/57/e9258cabcccedcd8c82b63a9feb898dae75aff87a75c8abb008e10f229d5/openapiart-0.3.29.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-28 13:40:53",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "open-traffic-generator",
"github_project": "openapiart",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "openapiart"
}