Git Product home page Git Product logo

cjvalpy's Issues

Error: 'CJValidator' object has no attribute 'get_report' both in shell and python code

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.