openapi-core


Nameopenapi-core JSON
Version 0.19.3 PyPI version JSON
download
home_pagehttps://github.com/python-openapi/openapi-core
Summaryclient-side and server-side support for the OpenAPI Specification v3
upload_time2024-08-14 09:14:10
maintainerNone
docs_urlNone
authorArtur Maciag
requires_python<4.0.0,>=3.8.0
licenseBSD-3-Clause
keywords openapi swagger schema
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            ************
openapi-core
************

.. image:: https://img.shields.io/pypi/v/openapi-core.svg
     :target: https://pypi.python.org/pypi/openapi-core
.. image:: https://travis-ci.org/python-openapi/openapi-core.svg?branch=master
     :target: https://travis-ci.org/python-openapi/openapi-core
.. image:: https://img.shields.io/codecov/c/github/python-openapi/openapi-core/master.svg?style=flat
     :target: https://codecov.io/github/python-openapi/openapi-core?branch=master
.. image:: https://img.shields.io/pypi/pyversions/openapi-core.svg
     :target: https://pypi.python.org/pypi/openapi-core
.. image:: https://img.shields.io/pypi/format/openapi-core.svg
     :target: https://pypi.python.org/pypi/openapi-core
.. image:: https://img.shields.io/pypi/status/openapi-core.svg
     :target: https://pypi.python.org/pypi/openapi-core

About
#####

Openapi-core is a Python library that adds client-side and server-side support
for the `OpenAPI v3.0 <https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md>`__
and `OpenAPI v3.1 <https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md>`__ specification.


Key features
############

* **Validation** and **unmarshalling** of request and response data (including webhooks)
* **Integration** with popular libraries (Requests, Werkzeug) and frameworks (Django, Falcon, Flask, Starlette)
* Customization with media type **deserializers** and format **unmarshallers**
* **Security** data providers (API keys, Cookie, Basic and Bearer HTTP authentications)


Documentation
#############

Check documentation to see more details about the features. All documentation is in the "docs" directory and online at `openapi-core.readthedocs.io <https://openapi-core.readthedocs.io>`__


Installation
############

Recommended way (via pip):

.. code-block:: console

    pip install openapi-core

Alternatively you can download the code and install from the repository:

.. code-block:: console

    pip install -e git+https://github.com/python-openapi/openapi-core.git#egg=openapi_core


First steps
###########

Firstly create your OpenAPI object.

.. code-block:: python

    from openapi_core import OpenAPI

    openapi = OpenAPI.from_file_path('openapi.json')

Now you can use it to validate and unmarshal against requests and/or responses. 

.. code-block:: python

    # raises error if request is invalid
    result = openapi.unmarshal_request(request)

Retrieve validated and unmarshalled request data

.. code-block:: python

    # get parameters
    path_params = result.parameters.path
    query_params = result.parameters.query
    cookies_params = result.parameters.cookies
    headers_params = result.parameters.headers
    # get body
    body = result.body
    # get security data
    security = result.security

Request object should implement OpenAPI Request protocol. Check `Integrations <https://openapi-core.readthedocs.io/en/latest/integrations.html>`__ to find officially supported implementations.

For more details read about `Unmarshalling <https://openapi-core.readthedocs.io/en/latest/unmarshalling.html>`__ process.

If you just want to validate your request/response data without unmarshalling, read about `Validation <https://openapi-core.readthedocs.io/en/latest/validation.html>`__ instead.


Related projects
################
* `openapi-spec-validator <https://github.com/python-openapi/openapi-spec-validator>`__
    Python library that validates OpenAPI Specs against the OpenAPI 2.0 (aka Swagger), OpenAPI 3.0 and OpenAPI 3.1 specification. The validator aims to check for full compliance with the Specification.
* `openapi-schema-validator <https://github.com/python-openapi/openapi-schema-validator>`__
    Python library that validates schema against the OpenAPI Schema Specification v3.0 and OpenAPI Schema Specification v3.1.
* `bottle-openapi-3 <https://github.com/cope-systems/bottle-openapi-3>`__
    OpenAPI 3.0 Support for the Bottle Web Framework
* `pyramid_openapi3 <https://github.com/niteoweb/pyramid_openapi3>`__
    Pyramid addon for OpenAPI3 validation of requests and responses.
* `tornado-openapi3 <https://github.com/correl/tornado-openapi3>`__
    Tornado OpenAPI 3 request and response validation library.


License
#######

The project is under the terms of BSD 3-Clause License.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/python-openapi/openapi-core",
    "name": "openapi-core",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0.0,>=3.8.0",
    "maintainer_email": null,
    "keywords": "openapi, swagger, schema",
    "author": "Artur Maciag",
    "author_email": "maciag.artur@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/cf/34/26eef886b9a9470952ab248b961fea29e23c9fd5e5083371c1f7f0aa4443/openapi_core-0.19.3.tar.gz",
    "platform": null,
    "description": "************\nopenapi-core\n************\n\n.. image:: https://img.shields.io/pypi/v/openapi-core.svg\n     :target: https://pypi.python.org/pypi/openapi-core\n.. image:: https://travis-ci.org/python-openapi/openapi-core.svg?branch=master\n     :target: https://travis-ci.org/python-openapi/openapi-core\n.. image:: https://img.shields.io/codecov/c/github/python-openapi/openapi-core/master.svg?style=flat\n     :target: https://codecov.io/github/python-openapi/openapi-core?branch=master\n.. image:: https://img.shields.io/pypi/pyversions/openapi-core.svg\n     :target: https://pypi.python.org/pypi/openapi-core\n.. image:: https://img.shields.io/pypi/format/openapi-core.svg\n     :target: https://pypi.python.org/pypi/openapi-core\n.. image:: https://img.shields.io/pypi/status/openapi-core.svg\n     :target: https://pypi.python.org/pypi/openapi-core\n\nAbout\n#####\n\nOpenapi-core is a Python library that adds client-side and server-side support\nfor the `OpenAPI v3.0 <https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md>`__\nand `OpenAPI v3.1 <https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md>`__ specification.\n\n\nKey features\n############\n\n* **Validation** and **unmarshalling** of request and response data (including webhooks)\n* **Integration** with popular libraries (Requests, Werkzeug) and frameworks (Django, Falcon, Flask, Starlette)\n* Customization with media type **deserializers** and format **unmarshallers**\n* **Security** data providers (API keys, Cookie, Basic and Bearer HTTP authentications)\n\n\nDocumentation\n#############\n\nCheck documentation to see more details about the features. All documentation is in the \"docs\" directory and online at `openapi-core.readthedocs.io <https://openapi-core.readthedocs.io>`__\n\n\nInstallation\n############\n\nRecommended way (via pip):\n\n.. code-block:: console\n\n    pip install openapi-core\n\nAlternatively you can download the code and install from the repository:\n\n.. code-block:: console\n\n    pip install -e git+https://github.com/python-openapi/openapi-core.git#egg=openapi_core\n\n\nFirst steps\n###########\n\nFirstly create your OpenAPI object.\n\n.. code-block:: python\n\n    from openapi_core import OpenAPI\n\n    openapi = OpenAPI.from_file_path('openapi.json')\n\nNow you can use it to validate and unmarshal against requests and/or responses. \n\n.. code-block:: python\n\n    # raises error if request is invalid\n    result = openapi.unmarshal_request(request)\n\nRetrieve validated and unmarshalled request data\n\n.. code-block:: python\n\n    # get parameters\n    path_params = result.parameters.path\n    query_params = result.parameters.query\n    cookies_params = result.parameters.cookies\n    headers_params = result.parameters.headers\n    # get body\n    body = result.body\n    # get security data\n    security = result.security\n\nRequest object should implement OpenAPI Request protocol. Check `Integrations <https://openapi-core.readthedocs.io/en/latest/integrations.html>`__ to find officially supported implementations.\n\nFor more details read about `Unmarshalling <https://openapi-core.readthedocs.io/en/latest/unmarshalling.html>`__ process.\n\nIf you just want to validate your request/response data without unmarshalling, read about `Validation <https://openapi-core.readthedocs.io/en/latest/validation.html>`__ instead.\n\n\nRelated projects\n################\n* `openapi-spec-validator <https://github.com/python-openapi/openapi-spec-validator>`__\n    Python library that validates OpenAPI Specs against the OpenAPI 2.0 (aka Swagger), OpenAPI 3.0 and OpenAPI 3.1 specification. The validator aims to check for full compliance with the Specification.\n* `openapi-schema-validator <https://github.com/python-openapi/openapi-schema-validator>`__\n    Python library that validates schema against the OpenAPI Schema Specification v3.0 and OpenAPI Schema Specification v3.1.\n* `bottle-openapi-3 <https://github.com/cope-systems/bottle-openapi-3>`__\n    OpenAPI 3.0 Support for the Bottle Web Framework\n* `pyramid_openapi3 <https://github.com/niteoweb/pyramid_openapi3>`__\n    Pyramid addon for OpenAPI3 validation of requests and responses.\n* `tornado-openapi3 <https://github.com/correl/tornado-openapi3>`__\n    Tornado OpenAPI 3 request and response validation library.\n\n\nLicense\n#######\n\nThe project is under the terms of BSD 3-Clause License.\n\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "client-side and server-side support for the OpenAPI Specification v3",
    "version": "0.19.3",
    "project_urls": {
        "Documentation": "https://openapi-core.readthedocs.io",
        "Homepage": "https://github.com/python-openapi/openapi-core",
        "Repository": "https://github.com/python-openapi/openapi-core"
    },
    "split_keywords": [
        "openapi",
        " swagger",
        " schema"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f0087ed984041e003113c648583c6f3ee5a88510f8d69901d64aa08acec5cc67",
                "md5": "db2276248ebbf70b6ac2d2ce7ec18e48",
                "sha256": "88c8be49b083a39923ada4c1269919ba119ab617c951f901757a054a483988b0"
            },
            "downloads": -1,
            "filename": "openapi_core-0.19.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "db2276248ebbf70b6ac2d2ce7ec18e48",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0.0,>=3.8.0",
            "size": 103690,
            "upload_time": "2024-08-14T09:14:09",
            "upload_time_iso_8601": "2024-08-14T09:14:09.285340Z",
            "url": "https://files.pythonhosted.org/packages/f0/08/7ed984041e003113c648583c6f3ee5a88510f8d69901d64aa08acec5cc67/openapi_core-0.19.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cf3426eef886b9a9470952ab248b961fea29e23c9fd5e5083371c1f7f0aa4443",
                "md5": "c7c9cf156f39bbb2337df54c13fc6fec",
                "sha256": "5db6479ecccf76c52422961dc42b411b7625a802087d847251fdd66f0392b095"
            },
            "downloads": -1,
            "filename": "openapi_core-0.19.3.tar.gz",
            "has_sig": false,
            "md5_digest": "c7c9cf156f39bbb2337df54c13fc6fec",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0.0,>=3.8.0",
            "size": 109026,
            "upload_time": "2024-08-14T09:14:10",
            "upload_time_iso_8601": "2024-08-14T09:14:10.501670Z",
            "url": "https://files.pythonhosted.org/packages/cf/34/26eef886b9a9470952ab248b961fea29e23c9fd5e5083371c1f7f0aa4443/openapi_core-0.19.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-14 09:14:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "python-openapi",
    "github_project": "openapi-core",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": true,
    "lcname": "openapi-core"
}
        
Elapsed time: 0.49536s