Skip to main content

Validator for RAC JSON Schemas

Project description

rac_schema_validator

Validators for RAC JSONSchemas.

Requirements

Installation

The recommended way to install this package is using pip:

pip install rac_schema_validator

After installing pre-commit, install the git-hook scripts:

$ pre-commit install

Usage

This library has one main public method, is_valid(), which takes two required arguments:

  • the data to be validated
  • the JSONSchema to validate against

and a third optional argument:

  • a base schema to resolve references against (see official docs)
from rac_schema_validator import is_valid

data = {"key": "value" ... }
schema = { ... }
is_valid(data, schema)

Invalid data will raise a rac_schema_validator.exceptions.ValidationError, and an invalid schema will raise a jsonschema.exceptions.SchemaError.

Tests

rac_schema_validator comes with unit tests as well as linting. The easiest way to make sure all tests pass is to run tox from the root of the repository. This will execute all tests, and will also run autopep8 and flake8 linters against the codebase.

License

Code is released under an MIT license. SeeLICENSE.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rac_schema_validator-1.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rac_schema_validator-1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file rac_schema_validator-1.0.tar.gz.

File metadata

  • Download URL: rac_schema_validator-1.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for rac_schema_validator-1.0.tar.gz
Algorithm Hash digest
SHA256 dbf79bd32d7dfbfa62791c768d89f5347a0555f3eef8c6786c1290887e4912d4
MD5 dc185ae4a0a65208c618b1fc63042576
BLAKE2b-256 a70adb056a7700e0bcf35d739b4164679584f139c6c6964a177348125e9e89d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for rac_schema_validator-1.0.tar.gz:

Publisher: pythonpublish.yml on RockefellerArchiveCenter/rac_schema_validator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rac_schema_validator-1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for rac_schema_validator-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6fb51539722558e6d3c197f1fe0e35c9a51bc85c154db679f98161f2cd6525a6
MD5 a11e9e3335a697e261ec01103dc6b62e
BLAKE2b-256 f578ebde9509fd0baaa4b754c3e5f2046cf17f0c1e1d8b89b793fef1911623cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for rac_schema_validator-1.0-py3-none-any.whl:

Publisher: pythonpublish.yml on RockefellerArchiveCenter/rac_schema_validator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page