This project has been archived by its maintainers, and is no longer receiving any updates.
OpenAPI Parser
Useful for d42 universe and schemax lib.
Installation
python3 -m pip install schemax-openapi
Usage
import yaml
import schemax_openapi
from schemax_openapi import SchemaData
from typing import List
# Also could be JSON OpenAPI file
with open('my_openapi.yaml') as schema_file:
raw_schema = yaml.load(schema_file, yaml.FullLoader)
parsed_data: List[SchemaData] = schemax_openapi.collect_schema_data(raw_schema)
for item in parsed_data:
print(item.path)
print(item.response_schema_d42)
...
All the data is stored in SchemaData object, which has the following fields:
- http_method: HTTP method of the request.
- path: URL path of the request.
- converted_path: URL path converted to the camel-case for usage in schemax generation.
- args: Arguments of the request.
- queries: Query parameters of the request. Currently unsupported and always empty list:
[]. - interface_method: Interface name for usage in schemax generation.
- interface_method_humanized: Interface 'humanized' name for usage in schemax generation.
- schema_prefix: Schema prefix name for usage in schemax generation.
- schema_prefix_humanized: Schema prefix 'humanized' name for user in schemax generation.
- response_schema: Normalized response schema (without $ref).
- response_schema_d42: Converted to d42 response_schema.
- request_schema: Normalized request schema (without $ref).
- request_schema_d42: Converted to d42 request_schema.
- tags: Tags of the request from OpenAPI schema.
Metadata
Release files for schemax-openapi 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| schemax_openapi-0.1.0.tar.gz | 4.1 kB | Without provenance | Details for schemax_openapi-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| schemax_openapi-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for schemax_openapi-0.1.0-py3-none-any.whl |
Total release size: 8.9 kB
Release files / schemax_openapi-0.1.0.tar.gz
| Download URL | schemax_openapi-0.1.0.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
184148c9f289844e48e8a3766246ea371ba7b86c73a2dcd22160ac730a5efe0b
|
|
BLAKE2b-256 checksum How to use checksums |
0e2ba6b2517414145bc203cebd755ec498090e0fcb2b5e1a76b477a3390b9a54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / schemax_openapi-0.1.0-py3-none-any.whl
| Download URL | schemax_openapi-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c8e7dd305bdf87a8ffafa732e67631892ef281a344d1e6969311a119ef94b914
|
|
BLAKE2b-256 checksum How to use checksums |
4f59124d22ffd09a013c15b6635bbaa741588501e0f81e628f1d6541ecf7b857
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Security for schemax-openapi 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.