Skip to main content

A simple JSON schema checker

Project description

Python JSON Checker

A simple alternative to JSONSchema for JSON validation in Python programs.

Install from pip

pip install jsonism

Example usage

Import the checker

from jsonism.checker import validate

Basic flat objects

schema = {
    "Bob": str,
    "Lucy": int,
    "Bert": bool
}
input = {
    "Bob": "Is Bob",
    "Lucy": 13,
    "Bert": True
}
validate(input, schema)

Lists

input = ["Bob", "Alice", "John"]
schema = [str]
validate(input, schema)

Other stuff

input = {"Usernames": [{"username": "Bob", "age": 23}, {"username": "Bill", "age": 98}]}
schema = {"Usernames": [{"username": str, "age": int}]}
validate(input, schema)

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

jsonism-1.0.4.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

jsonism-1.0.4-py3-none-any.whl (4.0 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