Skip to main content

cityjson-index

Python bindings for the cityjson-index Rust crate — a SQLite-backed random-access index over CityJSONSeq streams for CityJSON 2.0 data.

The distribution name is cityjson-index; the import name is cityjson_index. The package ships its own prebuilt native library (built from the Rust C-ABI core) and wraps it with ctypes — no Rust toolchain is required on the user side. cityjson-index also depends on cityjson-lib==0.8.0 at runtime; each package ships its own native library (there is no shared .so).

Install

pip install cityjson-index

Prebuilt wheels are published for:

  • Linux x86_64 (manylinux)
  • macOS x86_64 and arm64
  • Windows AMD64

Python 3.11, 3.12, and 3.13 are supported.

Quick start

from cityjson_index import OpenedIndex

with OpenedIndex.open("city.idx") as index:
    package = index.get("building-42")
    print(package.id, len(package.payload))

Package source paths

Resolve one persisted backing path per package page while preserving order and duplicates:

with OpenedIndex.open("dataset") as index:
    refs = index.package_ref_page_after_record_id(None, 512)
    paths = index.package_source_paths(refs)
    for ref, source_path in zip(refs, paths, strict=True):
        print(ref.record_id, source_path)

Filtered reads

from cityjson_index import PackageFilter, PackageFilterSummary, LodSelection, OpenedIndex

with OpenedIndex.open("dataset") as index:
    cityobjects = index.lookup_cityobject_refs("building-42")
    refs = index.package_refs_for_cityobject(cityobjects[0])
    filter = PackageFilter(
        cityobject_types={"Building"},
        default_lod=LodSelection.HIGHEST,
        lods_by_type={"Building": LodSelection.Exact("2.0")},
    )

    summary = PackageFilterSummary()
    for package in index.read_filtered_packages(refs, filter):
        summary.add(package.diagnostics)
        print(package.model.summary().model_type)

    summary.ensure_requested_lods_available(filter)

Links

License

Dual-licensed under MIT or Apache-2.0, at your option.

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

If you're not sure about the file name format, learn more about wheel file names.

cityjson_index-0.11.0-py3-none-win_amd64.whl (2.7 MB view details)

Uploaded Python 3Windows x86-64

cityjson_index-0.11.0-py3-none-manylinux_2_28_x86_64.whl (3.2 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

cityjson_index-0.11.0-py3-none-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file cityjson_index-0.11.0-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for cityjson_index-0.11.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 0476e9dc3d61c5c8af5996b06dd12a52af7510061cd416154a312531c9679c3c
MD5 45ecbabe0917a98fc7ae24ccf22336ec
BLAKE2b-256 6a7dc452cc7c17f64531d35a25e76649fa587dfa00526249ee8441bd5b199a44

See more details on using hashes here.

Provenance

The following attestation bundles were made for cityjson_index-0.11.0-py3-none-win_amd64.whl:

Publisher: release.yml on 3DGI/cityjson-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cityjson_index-0.11.0-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cityjson_index-0.11.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b4670f1ee5180cc9f62551495265436533e995b994b72071a3e61d66c9dba557
MD5 29a5d37f7e7fbac29a580d94f15bfa2c
BLAKE2b-256 478732b7b92ead4b8e6d77ec4bf74988f42f7032954769082b98e94a616219e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for cityjson_index-0.11.0-py3-none-manylinux_2_28_x86_64.whl:

Publisher: release.yml on 3DGI/cityjson-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cityjson_index-0.11.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cityjson_index-0.11.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8867dcfeb9d1659057af5316f9d8a504c11e80e5865420b87b88be702c268045
MD5 aca6e5af918a01c226b5b2d53ec3682e
BLAKE2b-256 d8516b8a6231ddca8c19ab5f79a8c5e27cc10a47cc9ab0a4a5f44a72b795f026

See more details on using hashes here.

Provenance

The following attestation bundles were made for cityjson_index-0.11.0-py3-none-macosx_11_0_arm64.whl:

Publisher: release.yml on 3DGI/cityjson-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.11.0 This release

3 files

0.10.0

3 files

0.9.0

3 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page