Python bindings of cjval, the official validator for CityJSON files.
To install the latest release: pip install cjvalpy
- install Rust (v1.39+)
- install maturin
maturin develop
- move to another folder, and
import cjvalpy
shouldn't return any error
Made to be used with cjio:
cjio myfile.city.json validate
but can be used directly in python:
import cjvalpy
import json
f = open("/home/elvis/mydata/myfile.city.json")
fj = f.read()
val = cjvalpy.CJValidator([fj])
re = val.validate()
if re == True:
print("✅")
else:
print("oh no invalid 😢")
print(val.get_report())