Skip to main content

The Python bindings of the official CityJSON validator

Project description

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

If you want to compile it yourself

  1. install latest Rust
  2. install maturin
  3. maturin build --release
  4. cd ./target/wheels/
  5. pip install [name-wheel].whl will install it to your local Python

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
import urllib.request

f = open("~/data/noise.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())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

cjvalpy-0.4.1-cp311-none-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.11 Windows x86-64

cjvalpy-0.4.1-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (2.6 MB view details)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

cjvalpy-0.4.1-cp310-none-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.10 Windows x86-64

cjvalpy-0.4.1-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (2.6 MB view details)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

cjvalpy-0.4.1-cp39-none-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.9 Windows x86-64

cjvalpy-0.4.1-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (2.6 MB view details)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

cjvalpy-0.4.1-cp38-none-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.8 Windows x86-64

cjvalpy-0.4.1-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (2.6 MB view details)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

File details

Details for the file cjvalpy-0.4.1-cp311-none-win_amd64.whl.

File metadata

File hashes

Hashes for cjvalpy-0.4.1-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 44d40cc10e7719ee0b3c20c7d0eea8b39ed68670eb1c014e1472d0da0a72f68d
MD5 67b034ba42ddd4f519cc75b662d0d916
BLAKE2b-256 6fc17b46ff65be9c8dd2a8560cc0851d73989e1796a6faf1cba6a6b845b22869

See more details on using hashes here.

File details

Details for the file cjvalpy-0.4.1-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for cjvalpy-0.4.1-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 7aebc9233be5d32109dc760c73b8d8a01b45f1d5ef235a8bd238d9234bd38bd4
MD5 c26e1fcc2fdc9f757fc2f9f282810e68
BLAKE2b-256 3a6a44f67d3164e88f9da2df8d525762fa62a31b553e47e2e1ae4c67f167ebbf

See more details on using hashes here.

File details

Details for the file cjvalpy-0.4.1-cp310-none-win_amd64.whl.

File metadata

File hashes

Hashes for cjvalpy-0.4.1-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 34e40838737fad68aef0774182b984e6949160b5dd31ca18078f0168ce120e4b
MD5 6a11221c2f53722a69306a7e3f7fc4d4
BLAKE2b-256 ed43b674d49500270f7c2d7dd304e395db25ba271ed5a9ec2466e3515bd08000

See more details on using hashes here.

File details

Details for the file cjvalpy-0.4.1-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for cjvalpy-0.4.1-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 56913300115cc7e96bdfe9be318fe3c3f2e6a20866ef3b686bd17a72c90f8fdb
MD5 79add58aa418c7683e63096e3a8593cb
BLAKE2b-256 92114927220b044f825b5ef4b4901fb0abe3994914911f46551fd02678970ee4

See more details on using hashes here.

File details

Details for the file cjvalpy-0.4.1-cp39-none-win_amd64.whl.

File metadata

File hashes

Hashes for cjvalpy-0.4.1-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 bd47e4b4bad5620840bf64efa96e33a32d764cd5a7f7181c8d329fb772948915
MD5 6c4ba26faf69425a43130712bf1b0755
BLAKE2b-256 308c54fd461836e04d935c4e985e5b3271d708da21847101a58dfce477e448d4

See more details on using hashes here.

File details

Details for the file cjvalpy-0.4.1-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for cjvalpy-0.4.1-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 fdfa947f299c6bc17d680552491152e1071788c17eafceb173bd50fdf1bb4d54
MD5 10c0d02cb841fb87455b58616be058db
BLAKE2b-256 cfecb47f1541c0a625f70f16a2694e5346a03e87f24a0d6c23d8bbdc7e566b46

See more details on using hashes here.

File details

Details for the file cjvalpy-0.4.1-cp38-none-win_amd64.whl.

File metadata

File hashes

Hashes for cjvalpy-0.4.1-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 400f04dd35786187d36beade483b483cbc0410faff7c7fab74ebab59d881773b
MD5 1c18765ff421e98b87ea9940394b8658
BLAKE2b-256 237013259010b1a9bd2d2fda18bfbd4466618676f89da33d5a83fc34b874e8c4

See more details on using hashes here.

File details

Details for the file cjvalpy-0.4.1-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for cjvalpy-0.4.1-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 9623b5ac378727eb1dc47e288acede7f315fbb4d315ba9a3443fc6ac2ab62894
MD5 c34ed616c30163bae397b5d65e224829
BLAKE2b-256 1862955598b265dcb5942acf7c6179f10df093ec0a38f8a64b0cdcec9e743ab0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page