Skip to content

hugoledoux/cjvalpy

 
 

Repository files navigation

cjvalpy

GitHub license PyPI version

Python bindings of cjval, the official validator for CityJSON files.

Installation

pip

To install the latest release: pip install cjvalpy

Development

  1. install Rust (v1.39+)
  2. install maturin
  3. maturin develop
  4. move to another folder, and import cjvalpy shouldn't return any error

Usage

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())

Releases

No releases published

Packages

No packages published

Languages

  • Rust 88.9%
  • Python 11.1%