openapiart


Nameopenapiart JSON
Version 0.3.11 PyPI version JSON
download
home_pagehttps://github.com/open-traffic-generator/openapiart
SummaryThe OpenAPI Artifact Generator Python Package
upload_time2024-03-22 11:48:19
maintainerNone
docs_urlNone
authorhttps://github.com/open-traffic-generator/openapiart
requires_python<4,>=2.7
licenseMIT
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": "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/d0/ca/4bab118e06dc667134b5934dc16ab3bfc5077c8053b31458695c42cedb35/openapiart-0.3.11.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": "MIT",
    "summary": "The OpenAPI Artifact Generator Python Package",
    "version": "0.3.11",
    "project_urls": {
        "Homepage": "https://github.com/open-traffic-generator/openapiart"
    },
    "split_keywords": [
        "testing",
        "openapi",
        "artifact",
        "generator"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fa4ca3ca25058da0c8addd0b9ae59e5961fbbc4ca411cdc99a3d99178c428c51",
                "md5": "4d6a0a8a53e34ba539603a692ccecb05",
                "sha256": "de2827e941b3a541d29b5830b6da83bde218227bf59f69f30dc56c6de5c0689b"
            },
            "downloads": -1,
            "filename": "openapiart-0.3.11-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4d6a0a8a53e34ba539603a692ccecb05",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": "<4,>=2.7",
            "size": 136899,
            "upload_time": "2024-03-22T11:48:16",
            "upload_time_iso_8601": "2024-03-22T11:48:16.696306Z",
            "url": "https://files.pythonhosted.org/packages/fa/4c/a3ca25058da0c8addd0b9ae59e5961fbbc4ca411cdc99a3d99178c428c51/openapiart-0.3.11-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d0ca4bab118e06dc667134b5934dc16ab3bfc5077c8053b31458695c42cedb35",
                "md5": "4956bb65fcd3a4e53c74e1cca0b25852",
                "sha256": "6da05aa20495f291e36c5595f2ccd37b2c6e159cc9561a1a1faeb09954fea91d"
            },
            "downloads": -1,
            "filename": "openapiart-0.3.11.tar.gz",
            "has_sig": false,
            "md5_digest": "4956bb65fcd3a4e53c74e1cca0b25852",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=2.7",
            "size": 106757,
            "upload_time": "2024-03-22T11:48:19",
            "upload_time_iso_8601": "2024-03-22T11:48:19.466285Z",
            "url": "https://files.pythonhosted.org/packages/d0/ca/4bab118e06dc667134b5934dc16ab3bfc5077c8053b31458695c42cedb35/openapiart-0.3.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-22 11:48:19",
    "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: 0.29065s