openapi-core 0.19.5
pip install openapi-core
Released:
client-side and server-side support for the OpenAPI Specification v3
Navigation
Verified details
These details have been verified by PyPIProject links
GitHub Statistics
Maintainers
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: BSD License (BSD-3-Clause)
- Author: Artur Maciag
- Tags openapi, swagger, schema
- Requires: Python <4.0.0, >=3.8.0
-
Provides-Extra:
aiohttp
,django
,falcon
,fastapi
,flask
,requests
,starlette
Classifiers
- Development Status
- Intended Audience
- License
- Operating System
- Programming Language
- Topic
- Typing
Project description
openapi-core
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.
Project details
Verified details
These details have been verified by PyPIProject links
GitHub Statistics
Maintainers
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: BSD License (BSD-3-Clause)
- Author: Artur Maciag
- Tags openapi, swagger, schema
- Requires: Python <4.0.0, >=3.8.0
-
Provides-Extra:
aiohttp
,django
,falcon
,fastapi
,flask
,requests
,starlette
Classifiers
- Development Status
- Intended Audience
- License
- Operating System
- Programming Language
- Topic
- Typing
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file openapi_core-0.19.5.tar.gz
.
File metadata
- Download URL: openapi_core-0.19.5.tar.gz
- Upload date:
- Size: 103.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 421e753da56c391704454e66afe4803a290108590ac8fa6f4a4487f4ec11f2d3 |
|
MD5 | 94aac6f00ce65182d083041bf314130a |
|
BLAKE2b-256 | b1351acaa5f2fcc6e54eded34a2ec74b479439c4e469fc4e8d0e803fda0234db |
Provenance
The following attestation bundles were made for openapi_core-0.19.5.tar.gz
:
Publisher:
python-publish.yml
on python-openapi/openapi-core
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
openapi_core-0.19.5.tar.gz
- Subject digest:
421e753da56c391704454e66afe4803a290108590ac8fa6f4a4487f4ec11f2d3
- Sigstore transparency entry: 185745500
- Sigstore integration time:
- Permalink:
python-openapi/openapi-core@3143d4fa6a9323330a3478cc8da2bb0bec25209b
- Branch / Tag:
refs/tags/0.19.5
- Owner: https://github.com/python-openapi
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
python-publish.yml@3143d4fa6a9323330a3478cc8da2bb0bec25209b
- Trigger Event:
release
- Statement type:
File details
Details for the file openapi_core-0.19.5-py3-none-any.whl
.
File metadata
- Download URL: openapi_core-0.19.5-py3-none-any.whl
- Upload date:
- Size: 106.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef7210e83a59394f46ce282639d8d26ad6fc8094aa904c9c16eb1bac8908911f |
|
MD5 | d63574a789aec14f4d17fdf810b19773 |
|
BLAKE2b-256 | 276f83ead0e2e30a90445ee4fc0135f43741aebc30cca5b43f20968b603e30b6 |
Provenance
The following attestation bundles were made for openapi_core-0.19.5-py3-none-any.whl
:
Publisher:
python-publish.yml
on python-openapi/openapi-core
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
openapi_core-0.19.5-py3-none-any.whl
- Subject digest:
ef7210e83a59394f46ce282639d8d26ad6fc8094aa904c9c16eb1bac8908911f
- Sigstore transparency entry: 185745502
- Sigstore integration time:
- Permalink:
python-openapi/openapi-core@3143d4fa6a9323330a3478cc8da2bb0bec25209b
- Branch / Tag:
refs/tags/0.19.5
- Owner: https://github.com/python-openapi
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
python-publish.yml@3143d4fa6a9323330a3478cc8da2bb0bec25209b
- Trigger Event:
release
- Statement type: