Skip to main content

flatcitybuf

A from-scratch, pure-Python reader for FlatCityBuf, a cloud-optimized binary format for 3D city models: CityJSON's semantics in FlatBuffers, with a packed Hilbert R-tree for spatial queries, a static B+tree for attribute queries, and HTTP range requests so a client fetches only the bytes it needs. No FFI and no compiled extension — a single py3-none-any wheel on CPython 3.9+, with flatbuffers as its only required dependency. Reader only: write .fcb files with the Rust CLI or the C++ writer.

pip install flatcitybuf          # or: uv pip install flatcitybuf
pip install "flatcitybuf[numpy]" # optional: ~2.4x faster bulk decoding
import json
import flatcitybuf as fcb

reader = fcb.FcbReader.open_file("city.fcb")

# The CityJSONSeq header line.
print(json.dumps(fcb.to_cityjson_metadata(reader.header)))

# Every feature, in stored (Hilbert) order.
for feature in reader.select_all():
    cj = fcb.to_cityjson_feature(feature, reader.header)

# Over HTTP, byte-range by byte-range (synchronously).
remote = fcb.FcbReader.open(fcb.HttpRangeReader("https://example.com/city.fcb"))

Attribute and spatial queries, the optional-numpy story, development commands, and the migration notes for users of the retired PyO3 extension (0.2.0 and earlier, whose API this does not drop-in replace) are all in the guide:

License

MIT — see LICENSE.

Download files

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

Source Distribution

flatcitybuf-0.5.1.tar.gz (199.0 kB view details)

Uploaded Source

Built Distribution

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

flatcitybuf-0.5.1-py3-none-any.whl (85.1 kB view details)

Uploaded Python 3

File details

Details for the file flatcitybuf-0.5.1.tar.gz.

File metadata

  • Download URL: flatcitybuf-0.5.1.tar.gz
  • Upload date:
  • Size: 199.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for flatcitybuf-0.5.1.tar.gz
Algorithm Hash digest
SHA256 f6a6b536f708a23bc184b6b78939fc3367bd8b89ab3aa6c47b0bde2bb79b82d7
MD5 5604a1bc4eb927a0b5a94e45fd1cd3a0
BLAKE2b-256 f853fd97ab40a79cd3ea343ad2df6b90ce2d7585a33c223a3f343b2624b53568

See more details on using hashes here.

File details

Details for the file flatcitybuf-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: flatcitybuf-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 85.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for flatcitybuf-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c1451870284504cfe988783349313ff2ea166c34d1a93d2d45930e437f0f025e
MD5 ec292f330adbee31f0858bfb1aa8f83f
BLAKE2b-256 76cf6fbe0ef3be0d746dc29642323f23157c5a4fde7f603e6da67df6e55d1880

See more details on using hashes here.

Release history Release notifications | RSS feed

0.5.2

2 files

This release

0.5.1 This release

2 files

0.5.0

2 files

0.4.0

2 files

0.3.1

2 files

0.2.0

3 files

0.1.2

3 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