Metadata-Version: 2.1
Name: cjvalpy
Version: 0.3.2
Classifier: License :: OSI Approved :: MIT License
Requires-Dist: toml==0.10.2
Summary: The Python bindings of the official CityJSON validator
Home-Page: https://github.com/hugoledoux/cjvalpy
Author: Hugo Ledoux <h.ledoux@tudelft.nl>
Author-email: Hugo Ledoux <h.ledoux@tudelft.nl>
License: MIT
Requires-Python: >=3.7
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Source Code, https://github.com/hugoledoux/cjvalpy

# cjvalpy

[![GitHub license](https://img.shields.io/github/license/cityjson/cjvalpy)](https://github.com/cityjson/cjvalpy/blob/main/LICENSE) 
[![PyPI version](https://badge.fury.io/py/cjvalpy.svg)](https://badge.fury.io/py/cjvalpy)

Python bindings of [cjval](https://github.com/cityjson/cjval), the official validator for [CityJSON](https://cityjson.org) files.


## Installation

### pip

To install the latest release: `pip install cjvalpy`

### Development

  1. install [Rust](https://www.rust-lang.org/) (v1.39+)
  2. install [maturin](https://github.com/PyO3/maturin) 
  3. `maturin develop`
  4. move to another folder, and `import cjvalpy` shouldn't return any error


## Usage

Made to be used with [cjio](https://github.com/cityjson/cjio): 

```bash
cjio myfile.city.json validate
```

but can be used directly in python:

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



