Skip to main content

ArrowTiles (arrowtiles)

License: Apache-2.0 DuckDB Rust Python

ArrowTiles (pip install arrowtiles) is a deterministic DuckDB + Rust (PyO3) spatial pyramid builder, reference reader, and validator that packs multi-million to billion-row Parquet datasets (verified end-to-end on 1,348,176,623 local ESA Gaia DR3 stars from the 1.8B-star survey and 2,835,490 LMSys UMAP embeddings) into single-file, HTTP Range-streamable .arrowtiles (v0.1) archives.


Why .arrowtiles? ("PMTiles for Point Clouds & Embeddings")

Traditional multiscale scatterplots write hundreds of thousands of tiny .feather or .bin files (exhausting S3 PUT budgets and browser HTTP connection pools), while raw remote Parquet files require fetching wide multi-megabyte row groups for coarse overviews.

.arrowtiles packs a multiscale priority quadtree of Zstd-compressed, schema-stripped Apache Arrow IPC RecordBatches inside a standard PMTiles v3 single-file container:

  • Single-file CDN/S3 deployment: Zero server logic—any static bucket or HTTP Range server streams tiles directly to WebGPU workers.
  • Byte-for-byte deterministic builds: Rebuilding the same Parquet input produces an identical SHA-256 .arrowtiles archive across runs and --resume checkpoints.
  • Zero-copy GPU column alignment: Coordinates quantize to x_u16 / y_u16 per tile while categorical dictionaries (UInt8/UInt16) and global column min/max statistics live in the single PMTiles JSON header.

Architecture: Deterministic 2-Pass Pipeline

flowchart TD
    A[("Input Parquet File(s) / Glob")] -->|"Single-Pass SQL Preflight + Priority Order"| B["DuckDB Out-of-Core Stream"]
    subgraph "Pass 1: Deterministic 2-Stage Bucketing (Rust PyO3)"
        B -->|"Arrow C Data Interface"| C["Stage A (Rayon): Stateless 20-bit Hilbert & Cell Coords"]
        C --> D["Stage B (Sequential): Priority Slot Claiming (even_coverage / proportional)"]
        D --> E[("Per-Zoom Partitions: partitions/z_00..z_NN.parquet + SHA-256 manifest.json")]
    end
    subgraph "Pass 2: Per-Zoom Hilbert Sort & Parallel Zstd Packing"
        E -->|"Per-Zoom Hilbert Order"| F["DuckDB Per-Level Stream"]
        F -->|"Arrow C Data Interface"| G["Rust Rayon Pool: Strip Arrow Schema + Zstd Compress"]
        G --> H[("Single .arrowtiles Archive (PMTiles v3)")]
    end
  1. Single-Pass SQL Preflight (arrowtiles/builder.py): DuckDB computes global bounds, row counts, id_col uniqueness, numeric min/max stats, and categorical dictionaries in one scan—automatically omitting unrequested Pandas index columns (__index_level_<N>__) and high-cardinality free-text columns (distinct > 4,096), and downcasting finite in-range Float64 (DOUBLE) payload columns to Float32 unless --keep-float64 is passed.
  2. Pass 1 — Zero-Atomic 2-Stage Bucketer (arrowtiles-engine/src/lib.rs): DuckDB streams rows ordered by (priority_key, row_id ASC)—either an explicit sort_col (e.g. phot_g_mean_mag ASC) or portable SplitMix64(row_id, seed)—into Rust via the Arrow C Data Interface. Stage A computes fast_hilbert coordinates across all CPU cores; Stage B assigns zoom levels deterministically without atomic contention and writes per-zoom Parquet partitions (z_00.parquet .. z_NN.parquet) plus a cryptographic manifest.json (--resume).
  3. Pass 2 — Per-Zoom Packing: Each zoom partition is sorted in memory by (tile_id, hilbert_20, priority_ord), stripped of redundant per-tile Arrow IPC schema headers (stored once as base64 arrow_schema in metadata), Zstd-compressed in parallel via Rayon, and written into a PMTiles v3 archive.

Installation & Source Build

pip install arrowtiles

Building from Source (Python 3.10+ & Rust 1.80+)

git clone https://github.com/kai-erlenbusch/arrowtiles.git
cd arrowtiles

python -m venv .venv
# Windows: .venv\Scripts\activate   |   Linux/macOS: source .venv/bin/activate

pip install "maturin>=1.4,<2.0"
pip install -e ".[dev]" --no-build-isolation
maturin develop --release

# Run the test suite (67 tests):
pytest -v

CLI Usage (arrowtiles / python -m arrowtiles)

# 1. Generic 2D embedding / point cloud (select active visual columns for fast overview streaming):
arrowtiles build \
  --input "embeddings.parquet" \
  --output "embeddings.arrowtiles" \
  --x-col x_umap --y-col y_umap \
  --columns model clusters_14 num_of_tokens \
  --categorical-cols clusters_14

# 2. ESA Gaia DR3 Hammer sky preset (phot_g_mean_mag ASC + even_coverage, 100k tile capacity):
arrowtiles build \
  --preset gaia \
  --input "gaia_batches/*.parquet" \
  --output "gaia.arrowtiles"

# 3. Validate an .arrowtiles archive against SPEC.md v0.1 (human report or --json):
arrowtiles validate "embeddings.arrowtiles"

# 4. Inspect PMTiles header, Arrow schema, and JSON metadata:
arrowtiles inspect "embeddings.arrowtiles"

Wide Tables & --columns: Each .arrowtiles v0.1 tile packs all retained columns into one Arrow IPC RecordBatch so browsers fetch an entire tile in 1 HTTP Range request. On wide 30+-column tables, pass --columns <col1> <col2> ... (space- or comma-separated) to retain only the columns needed for visual encoding and keep Z=0..2 overview bytes below 10 MiB.

Key arrowtiles build Options

Argument Description
--input (Required) Path or glob pattern to input Parquet file(s).
--output (Required) Output .arrowtiles archive path.
--x-col, --y-col Source coordinate columns (required for generic builds).
--columns Space- or comma-separated subset of payload columns to retain in tiles.
--categorical-cols Space- or comma-separated columns (including integer cluster IDs) to dictionary-encode as UInt8/UInt16.
--preset gaia Astronomical Galactic Hammer projection (phot_g_mean_mag ASC, even_coverage, 100,000 tile capacity).
--sampling proportional (generic default, 25,000 capacity) or even_coverage (G×G sub-grid occupancy at Z <= 6).
--tile-capacity Max rows per non-leaf tile (25,000 generic default; 100,000 on --preset gaia).
--max-zoom Nominal maximum quadtree zoom level before overflow spilling (default: 14).
--sort-col, --sort-dir Explicit priority column (ASC or DESC); defaults to deterministic SplitMix64(row_id, seed).
--seed Random seed for default SplitMix64 priority ordering (default: 42).
--id-col Optional unique unsigned integer row ID column (defaults to dense 0 .. N-1 Parquet offset).
--keep-source-xy Retain raw Float32/Float64 source X/Y columns alongside quantized x_u16/y_u16.
--keep-float64 Retain Float64 (DOUBLE) payload columns instead of downcasting in-range floats to Float32.
--temp-dir, --resume Persist Pass 1 zoom partitions in --temp-dir and reuse verified SHA-256 manifest.json on --resume.

Python API Reference

from arrowtiles import ArrowTilesReader, build_gaia, build_generic, validate_file

# 1. Build a v0.1 archive from Parquet:
summary = build_generic(
    input_parquet="embeddings.parquet",
    output_path="embeddings.arrowtiles",
    x_col="x_umap",
    y_col="y_umap",
    columns=["model", "num_of_tokens"],
    sampling="proportional",
)

# 2. Validate SPEC.md v0.1 invariants:
report = validate_file("embeddings.arrowtiles")
assert report.ok, report.errors

# 3. Inspect metadata and read decoded pyarrow.Table tiles:
with ArrowTilesReader("embeddings.arrowtiles") as reader:
    header = reader.header()       # PMTiles v3 header dict (max_zoom, num_addressed_tiles, ...)
    meta = reader.metadata()       # ArrowTiles v0.1 JSON metadata (bounds, stats, priority, ...)
    schema = reader.schema()       # pyarrow.Schema of stored tile columns
    coords = reader.list_tiles()   # [(z, x, y), ...] non-empty tile coordinates

    # Read root tile (0, 0, 0) with dequantized (x_decoded, y_decoded) & string category labels:
    root_table = reader.read_tile(0, 0, 0, decode_coords=True, decode_categories=True)

    # Stream all non-empty tiles in PMTiles Hilbert order:
    for (z, x, y), tile_table in reader.iter_tiles(decode_coords=False):
        pass

For contributor invariants and wire-format rules, see AGENTS.md and docs/SPEC.md.


Roadmap

  • 2.5D Extrusion & 3D Octree Tiling (tiling: "octree-3d"): Extending the 53-bit PMTiles tile_id curve and xyz_u16 quantization to volumetric 3D point clouds while v0.1 readers cleanly gate on "tiling" and "required_features".
  • Single-File Column Groups (v0.2+): Partitioning wide scientific tables into a core geometry group plus on-demand attribute column groups inside a single .arrowtiles archive.
  • Python / Jupyter Integration (pydeepgraph): Interactive anywidget embedding powered by deepgraph and ArrowTilesReader.
  • Loadable DuckDB Extension: Native COPY (...) TO 'out.arrowtiles' (FORMAT ARROWTILES) SQL sink.

Citing

If you use ArrowTiles in academic or scientific work, please cite:

Erlenbusch, K. (2026). ArrowTiles: Spatial Pyramid Format and DuckDB + Rust Builder for Large-Scale Point Clouds and Embeddings [Computer software]. https://github.com/kai-erlenbusch/arrowtiles

Licensing

Licensed under the Apache License 2.0. See LICENSE and NOTICE.

Data Attribution

  • ESA Gaia DR3: Gaia data © ESA/Gaia/DPAC (attribution required).
  • LMSys-Chat-1M: Subject to its upstream dataset terms and is not redistributed in this repository.

Metadata

Release files for arrowtiles 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for arrowtiles 0.1.1
File Size Uploaded Provenance Actions
arrowtiles-0.1.1.tar.gz 67.7 kB With provenance Details for arrowtiles-0.1.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for arrowtiles 0.1.1
File Actions
arrowtiles-0.1.1-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for arrowtiles-0.1.1-cp39-abi3-win_amd64.whl
arrowtiles-0.1.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for arrowtiles-0.1.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
arrowtiles-0.1.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for arrowtiles-0.1.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
arrowtiles-0.1.1-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for arrowtiles-0.1.1-cp39-abi3-macosx_11_0_arm64.whl
arrowtiles-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for arrowtiles-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 22.7 MB

Release files / arrowtiles-0.1.1.tar.gz

Download URL arrowtiles-0.1.1.tar.gz
Size 67.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2289935b7e2d8e0c24c945e71fc3872793ff3398699536568776f4946fda3fc5
BLAKE2b-256 checksum
How to use checksums
362c2f7e713dba35d3efbd6323d0ca28909d6fbd3e20549e5136d0570ea9ae43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / arrowtiles-0.1.1-cp39-abi3-win_amd64.whl

Download URL arrowtiles-0.1.1-cp39-abi3-win_amd64.whl
Size 4.2 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
a11e89603fbab8b0a30af4ed5ceaa7763500fddfd52debed03b2761c090bb064
BLAKE2b-256 checksum
How to use checksums
accca143d0d7cf53c64f810a7d0a52a4123d8ebcf8572a29b8a997383a992f62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / arrowtiles-0.1.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL arrowtiles-0.1.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 4.9 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
7fc4bf4116d7223497573621910054324321fe017fe6a047c90a6745270ea183
BLAKE2b-256 checksum
How to use checksums
f42135aec564f9caf18f6ba8423102f88431bb5fb9f260486158f7a9b55a831f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / arrowtiles-0.1.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL arrowtiles-0.1.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 4.8 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
490574f71babdb25170f4f342c882a1872ebe76746bb652f32ce055fd210bad1
BLAKE2b-256 checksum
How to use checksums
0f575520fff668ca9500d9fc3ad4e6e2298dfe5f21a66ae1bc851b6b2b706ff6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / arrowtiles-0.1.1-cp39-abi3-macosx_11_0_arm64.whl

Download URL arrowtiles-0.1.1-cp39-abi3-macosx_11_0_arm64.whl
Size 4.2 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
784a51531382c8c7b90ab444dc0e8785d2f5a7d3d7ad019f9cc0089fbe885bce
BLAKE2b-256 checksum
How to use checksums
47407c5c7a792e8b20141ef2d0aa65a2c84b3ac326220f13a314f6bf8f24d78d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / arrowtiles-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl

Download URL arrowtiles-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl
Size 4.5 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
c2270696cc75c2c5e070a5e437c0909edeafe9a987f91dc9c58fa17377bdf897
BLAKE2b-256 checksum
How to use checksums
64a280ce2696b24404901b4a94f7436d2f9f930a91fbb008af052edc65aaff40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Security for arrowtiles 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for arrowtiles-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

6 release files Full provenance

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