openapi-core


Nameopenapi-core JSON
Version 0.19.1 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-04-10 18:19:43
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/a1/b7/c26a94fc4638b1add6068c0c6e2ba05e4df971c3b65e46594c62ae1dbd09/openapi_core-0.19.1.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.1",
    "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": "b4693d32f212887e9d6f5eaef23841a56976f398b26f77ae3aeca4bf95f1b0aa",
                "md5": "d25e1e9340f3c7b3c5f94c0ee8739cb1",
                "sha256": "a1eeb93d2a7e41a8c34ccebd55b180d1f73c5dddffbad657315746e955283cfc"
            },
            "downloads": -1,
            "filename": "openapi_core-0.19.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d25e1e9340f3c7b3c5f94c0ee8739cb1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0.0,>=3.8.0",
            "size": 103120,
            "upload_time": "2024-04-10T18:19:34",
            "upload_time_iso_8601": "2024-04-10T18:19:34.018977Z",
            "url": "https://files.pythonhosted.org/packages/b4/69/3d32f212887e9d6f5eaef23841a56976f398b26f77ae3aeca4bf95f1b0aa/openapi_core-0.19.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a1b7c26a94fc4638b1add6068c0c6e2ba05e4df971c3b65e46594c62ae1dbd09",
                "md5": "6fe0d212e792034a8e06498f2ccd419e",
                "sha256": "3facc2c87b7e9fb9909ae72bfb0b7cad20954e23fb4ef04dc5559197dee87597"
            },
            "downloads": -1,
            "filename": "openapi_core-0.19.1.tar.gz",
            "has_sig": false,
            "md5_digest": "6fe0d212e792034a8e06498f2ccd419e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0.0,>=3.8.0",
            "size": 107802,
            "upload_time": "2024-04-10T18:19:43",
            "upload_time_iso_8601": "2024-04-10T18:19:43.412243Z",
            "url": "https://files.pythonhosted.org/packages/a1/b7/c26a94fc4638b1add6068c0c6e2ba05e4df971c3b65e46594c62ae1dbd09/openapi_core-0.19.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-10 18:19:43",
    "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.23410s