Files
AmirAli 0108a31e9a extra data (#55)
* added: group, wxpos (wide x position), wypos(wide y position), block

* update: README.md
2022-12-22 16:29:27 -05:00

21 lines
611 B
Python
Executable File

#!/usr/bin/env python3
"""
Validate that the JSON data is correctly formatted according
to the template in the 'schemas' directory.
"""
import json
import jsonschema
PERIODIC_TABLE_JSON = "../PeriodicTableJSON.json"
PERIODIC_TABLE_SCHEMA = "../schemas/periodicTableJSON.schema"
print(f"Validating {PERIODIC_TABLE_JSON} against {PERIODIC_TABLE_SCHEMA}")
with open(PERIODIC_TABLE_JSON) as jfile, open(PERIODIC_TABLE_SCHEMA) as sfile:
data = json.load(jfile)
schema = json.load(sfile)
# Raises an exception in case of failure
jsonschema.validate(instance=data,schema=schema)
print("Validation passed")