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:
- Python guide — install, full API tour, tooling and testing.
- Runnable examples — eight scripts, one per capability, each with its real output. They run as part of the test suite, so they cannot drift.
- Format specification
- Project README
- Issue tracker
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flatcitybuf-0.3.1.tar.gz.
File metadata
- Download URL: flatcitybuf-0.3.1.tar.gz
- Upload date:
- Size: 199.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8c0413f4808838ba35d62b281f898b32fa791a70491f3bfa4615bcdab87f86a
|
|
| MD5 |
fcaac8fcd5426d7a7b17e436002a6855
|
|
| BLAKE2b-256 |
18bf47f054a564f9cc78742d0ec1231d62eab2b6aadc2a1d8c8766d3f19c270e
|
File details
Details for the file flatcitybuf-0.3.1-py3-none-any.whl.
File metadata
- Download URL: flatcitybuf-0.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e2fdff56958333bdf447b057f87ed13a82cf7ed76b7e3f53a31b84b0c1c325c
|
|
| MD5 |
3eda7e4b8331f4b0f13314b0f6fc6019
|
|
| BLAKE2b-256 |
dae55c95e73f70b05a89875719fe18fcafb7ff80bb16afa56bb5d1833dcb59a7
|