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


Release history Release notifications | RSS feed

This version

0.1

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-0.1.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

rac_schema_validator-0.1-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

Supported by

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