openapi-core 0.19.5


pip install openapi-core

  Latest version

Released: Mar 20, 2025


Meta
Author: Artur Maciag
Requires Python: >=3.8.0,<4.0.0

Classifiers

Development Status
  • 4 - Beta

Intended Audience
  • Developers

License
  • OSI Approved :: BSD License

Operating System
  • OS Independent

Programming Language
  • Python :: 3
  • Python :: 3.8
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13

Topic
  • Software Development :: Libraries
  • Software Development :: Libraries :: Python Modules

Typing
  • Typed

openapi-core

Package version Continuous Integration Tests coverage Python versions Package format Development status

About

Openapi-core is a Python library that provides client-side and server-side support for the OpenAPI v3.0 and OpenAPI v3.1 specifications.

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

Installation

Recommended way (via pip):

pip install openapi-core

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

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

First steps

First, create your OpenAPI object.

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.

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

Retrieve validated and unmarshalled request data.

# 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

The request object should implement the OpenAPI Request protocol. Check Integrations to find officially supported implementations.

For more details read about the Unmarshalling process.

If you just want to validate your request/response data without unmarshalling, read about Validation instead.

Related projects

  • openapi-spec-validator : A 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 : A Python library that validates schema against the OpenAPI Schema Specification v3.0 and OpenAPI Schema Specification v3.1.
  • bottle-openapi-3 : OpenAPI 3.0 Support for the Bottle Web Framework
  • pyramid_openapi3 : Pyramid addon for OpenAPI3 validation of requests and responses.
  • tornado-openapi3 : Tornado OpenAPI 3 request and response validation library.

License

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

0.19.5 Mar 20, 2025
0.19.4 Sep 02, 2024
0.19.3 Aug 14, 2024
0.19.2 Jun 12, 2024
0.19.1 Apr 10, 2024
0.19.0 Feb 14, 2024
0.19.0a2 Feb 11, 2024
0.19.0a1 Nov 22, 2023
0.18.2 Nov 06, 2023
0.18.1 Sep 14, 2023
0.18.0 Jul 10, 2023
0.18.0a1 Jun 18, 2023
0.17.2 Jun 15, 2023
0.17.1 Mar 17, 2023
0.17.0 Mar 06, 2023
0.17.0a3 Feb 20, 2023
0.17.0a2 Jan 26, 2023
0.17.0a1 Jan 23, 2023
0.16.6 Mar 02, 2023
0.16.5 Jan 19, 2023
0.16.4 Dec 21, 2022
0.16.3 Dec 20, 2022
0.16.2 Nov 25, 2022
0.16.1 Oct 10, 2022
0.16.0 Oct 04, 2022
0.15.0 Sep 12, 2022
0.15.0a2 Sep 07, 2022
0.15.0a1 Jun 03, 2022
0.14.5 Sep 02, 2022
0.14.4 Sep 02, 2022
0.14.3 Sep 02, 2022
0.14.2 May 14, 2021
0.14.1 May 08, 2021
0.14.0 May 07, 2021
0.13.8 May 01, 2021
0.13.7 Feb 15, 2021
0.13.6 Feb 09, 2021
0.13.5 Feb 01, 2021
0.13.4 Jul 20, 2020
0.13.3 Mar 11, 2020
0.13.2 Feb 24, 2020
0.13.1 Feb 18, 2020
0.13.0 Feb 17, 2020
0.12.0 Sep 21, 2019
0.11.1 Sep 07, 2019
0.11.0 Jun 18, 2019
0.10.0 May 21, 2019
0.9.0 Mar 22, 2019
0.8.0 Feb 28, 2019
0.7.1 Oct 29, 2018
0.7.0 Oct 25, 2018
0.6.0 Aug 23, 2018
0.5.0 May 30, 2018
0.4.3 Apr 24, 2018
0.4.2 Apr 04, 2018
0.4.1 Feb 28, 2018
0.4.0 Nov 14, 2017
0.3.4 Nov 06, 2017
0.3.3 Nov 06, 2017
0.3.2 Nov 06, 2017
0.3.1 Nov 06, 2017
0.3.0 Nov 03, 2017
0.2.2 Oct 19, 2017
0.2.1 Oct 18, 2017
0.2.0 Oct 17, 2017
0.1.4 Oct 09, 2017
0.1.3 Sep 25, 2017
0.1.2 Sep 25, 2017
0.1.1 Sep 25, 2017
0.1.0 Sep 22, 2017
0.0.1 Sep 21, 2017

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
isodate
jsonschema (<5.0.0,>=4.18.0)
jsonschema-path (<0.4.0,>=0.3.1)
more-itertools
openapi-schema-validator (<0.7.0,>=0.6.0)
openapi-spec-validator (<0.8.0,>=0.7.1)
parse
typing-extensions (<5.0.0,>=4.8.0)
werkzeug (<3.1.2)