openapiart


Nameopenapiart JSON
Version 0.3.37 PyPI version JSON
download
home_pageNone
SummaryThe OpenAPI Artifact Generator Python Package
upload_time2025-10-28 07:34:14
maintainerNone
docs_urlNone
authorNone
requires_python<4,>=3.8
licenseNone
keywords testing openapi artifact generator
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # openapiart - OpenAPI Artifact Generator

[![CICD](https://github.com/open-traffic-generator/openapiart/workflows/CICD/badge.svg)](https://github.com/open-traffic-generator/openapiart/actions)
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![python](https://img.shields.io/pypi/pyversions/openapiart.svg)](https://pypi.python.org/pypi/openapiart)
[![license](https://img.shields.io/badge/license-MIT-green.svg)](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": null,
    "name": "openapiart",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4,>=3.8",
    "maintainer_email": null,
    "keywords": "testing, openapi, artifact, generator",
    "author": null,
    "author_email": "Keysight Technologies <andy.balogh@keysight.com>",
    "download_url": "https://files.pythonhosted.org/packages/00/13/cbe5e0fb483f2204f2e15142f02c8335fa5c4639def0d3f27ddf77a60bf1/openapiart-0.3.37.tar.gz",
    "platform": null,
    "description": "# openapiart - OpenAPI Artifact Generator\n\n[![CICD](https://github.com/open-traffic-generator/openapiart/workflows/CICD/badge.svg)](https://github.com/open-traffic-generator/openapiart/actions)\n[![Project Status: Active \u2013 The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![python](https://img.shields.io/pypi/pyversions/openapiart.svg)](https://pypi.python.org/pypi/openapiart)\n[![license](https://img.shields.io/badge/license-MIT-green.svg)](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": null,
    "summary": "The OpenAPI Artifact Generator Python Package",
    "version": "0.3.37",
    "project_urls": {
        "Repository": "https://github.com/open-traffic-generator/openapiart"
    },
    "split_keywords": [
        "testing",
        " openapi",
        " artifact",
        " generator"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d5f8e71880c43ed9e640f12bade0e4faca4c5e84a8e5f1fecbf79c0f76671335",
                "md5": "e0e8c841ca85bca001ae63067933799b",
                "sha256": "5ad1f9c7e562119b64e5015cc3dd405b994d07c12a0c33ab185c1a2f79582194"
            },
            "downloads": -1,
            "filename": "openapiart-0.3.37-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e0e8c841ca85bca001ae63067933799b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.8",
            "size": 156307,
            "upload_time": "2025-10-28T07:34:12",
            "upload_time_iso_8601": "2025-10-28T07:34:12.962981Z",
            "url": "https://files.pythonhosted.org/packages/d5/f8/e71880c43ed9e640f12bade0e4faca4c5e84a8e5f1fecbf79c0f76671335/openapiart-0.3.37-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0013cbe5e0fb483f2204f2e15142f02c8335fa5c4639def0d3f27ddf77a60bf1",
                "md5": "215c74cc20daa17c20c66f4fb91efe5d",
                "sha256": "18103ae962c9f8baefe3ad5223d0dbaccd3b95b8d6076405207688ccedfdc769"
            },
            "downloads": -1,
            "filename": "openapiart-0.3.37.tar.gz",
            "has_sig": false,
            "md5_digest": "215c74cc20daa17c20c66f4fb91efe5d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.8",
            "size": 122338,
            "upload_time": "2025-10-28T07:34:14",
            "upload_time_iso_8601": "2025-10-28T07:34:14.534397Z",
            "url": "https://files.pythonhosted.org/packages/00/13/cbe5e0fb483f2204f2e15142f02c8335fa5c4639def0d3f27ddf77a60bf1/openapiart-0.3.37.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-28 07:34:14",
    "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"
}
        
Elapsed time: 9.58811s