cityjson / cjvalpy Goto Github PK
View Code? Open in Web Editor NEWPython bindings of cjval
Home Page: https://pypi.org/project/cjvalpy/
License: MIT License
Python bindings of cjval
Home Page: https://pypi.org/project/cjvalpy/
License: MIT License
steps
pip install cjvalpy cjio
!curl -LC - https://www.cityjson.org/tutorials/files/twobuildings.city.json -o two_buildings.city.json
execute
!cjio two_buildings.city.json validate
result from shell
Parsing two_buildings.city.json
Validation (with official CityJSON schemas)
Error: 'CJValidator' object has no attribute 'get_report'
code
import cjvalpy
import json
import urllib.request
f = open("two_buildings.city.json")
fj = json.loads(f.read())
js = []
js.append(json.dumps(fj))
print("Downloading the Extension JSON schema file(s):")
if "extensions" in fj:
for ext in fj["extensions"]:
theurl = fj["extensions"][ext]["url"]
try:
with urllib.request.urlopen(fj["extensions"][ext]["url"]) as f:
sf = f.read().decode('utf-8')
js.append(sf)
except:
s = "'%s' cannot be downloaded\nAbort" % fj["extensions"][ext]["url"]
raise Exception(s)
val = cjvalpy.CJValidator(js)
val.validate()
re = val.get_report()
print(val.get_report())
code result
AttributeError Traceback (most recent call last)
[<ipython-input-24-a3532499301e>](https://localhost:8080/#) in <cell line: 22>()
20 val = cjvalpy.CJValidator(js)
21 val.validate()
---> 22 re = val.get_report()
23 print(val.get_report())
AttributeError: 'CJValidator' object has no attribute 'get_report'
best regards
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.