JSONSchema Spec
About
Object-oriented JSONSchema
Key features
Traverse schema like paths
Access schema on demand with separate dereferencing accessor layer
Installation
pip install jsonschema-spec
Alternatively you can download the code and install from the repository:
pip install -e git+https://github.com/p1c2u/jsonschema-spec.git#egg=jsonschema_spec
Usage
>>> from jsonschema_spec import SchemaPath
>>> d = {
... "properties": {
... "info": {
... "$ref": "#/$defs/Info",
... },
... },
... "$defs": {
... "Info": {
... "properties": {
... "title": {
... "$ref": "http://example.com",
... },
... "version": {
... "type": "string",
... "default": "1.0",
... },
... },
... },
... },
... }
>>> path = SchemaPath.from_dict(d)
>>> # Stat keys
>>> "properties" in path
True
>>> # Concatenate paths with /
>>> info_path = path / "properties" / "info"
>>> # Stat keys with implicit dereferencing
>>> "properties" in info_path
True
>>> # Concatenate paths with implicit dereferencing
>>> version_path = info_path / "properties" / "version"
>>> # Open content with implicit dereferencing
>>> with version_path.open() as contents:
... print(contents)
{'type': 'string', 'default': '1.0'}
License
Copyright (c) 2017-2022, Artur Maciag, All rights reserved. Apache-2.0
Metadata
Release files for jsonschema-spec 0.2.4
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 |
|---|---|---|---|---|
| jsonschema_spec-0.2.4.tar.gz | 11.5 kB | Without provenance | Details for jsonschema_spec-0.2.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jsonschema_spec-0.2.4-py3-none-any.whl | Python 3 | none | any | Details for jsonschema_spec-0.2.4-py3-none-any.whl |
Total release size: 26.2 kB
Release files / jsonschema_spec-0.2.4.tar.gz
| Download URL | jsonschema_spec-0.2.4.tar.gz |
|---|---|
| Size | 11.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
873e396ad1ba6edf9f52d6174c110d4fafb7b5f5894744246a53fe75e5251ec2
|
|
BLAKE2b-256 checksum How to use checksums |
85bf5e9a059f611e8950eec986385892f9d596e4936fa58a37bf295789197f77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1042-azure
|
Release files / jsonschema_spec-0.2.4-py3-none-any.whl
| Download URL | jsonschema_spec-0.2.4-py3-none-any.whl |
|---|---|
| Size | 14.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e6dcf7056734ec6854f7888da6c08ce6c421f28aeeddce96bb90de0fb6d711ef
|
|
BLAKE2b-256 checksum How to use checksums |
d9a27759a4268e1d6d74559de8fb5be6c77d621b822ae64d28ab4f7467c22f63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1042-azure
|
Security for jsonschema-spec 0.2.4
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.