Skip to main content

lance_nd for Python

Store xarray datasets as N-dimensional Arrow arrays in a lance-nd table.

The package does three things:

  1. It converts each xarray.Dataset to an NdRecordBatch of the nd-arrow-array package.
  2. Rust writes the datasets to a lance-nd table, and commits all of them in one version when you call finish().
  3. It reads the table back as a stream of NdRecordBatch objects. Each object gives its dataset with to_xarray().

Install

Build the package from this directory with maturin:

python -m venv .venv
.venv/bin/python -m pip install maturin
.venv/bin/python -m maturin develop --release --extras dev

On Windows, use .venv/Scripts/python. The dev extra installs the test and type check tools.

Without --release, maturin builds the Rust code without optimizations, and writes are several times slower.

Usage

import xarray as xr
import lance_nd

# Create a table. Readers see nothing before finish().
with lance_nd.create("data.lance", stats=True) as writer:
    writer.write(ds_a)                   # an xarray.Dataset
    writer.write([ds_b, ds_c])           # a list of datasets

# Append dask chunks, one row per chunk.
with lance_nd.append("data.lance") as writer:
    writer.write(ds_d, chunks=["time"])

table = lance_nd.open("data.lance")
for batch in table.scan(filter="__global_attrs__.title = 'a'", prune="sst.values > 300"):
    ds = batch.to_xarray()               # an nd_arrow_array.NdRecordBatch

The Python wiki page explains the writer rules, chunks, encoding options, stats, scans, casting, object stores and the encoding rules.

Tests

.venv/bin/python -m pytest tests

tests/test_s3.py runs when LANCE_ND_S3_ENDPOINT points to an S3 server with the bucket lance-nd-test, see the Object stores wiki page.

Metadata

Release files for lance-nd 0.1.0

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

Source distribution (sdist)

Source distribution for lance-nd 0.1.0
File Size Uploaded Provenance Actions
lance_nd-0.1.0.tar.gz 138.7 kB With provenance Details for lance_nd-0.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for lance-nd 0.1.0
File Actions
lance_nd-0.1.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for lance_nd-0.1.0-cp310-abi3-win_amd64.whl
lance_nd-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.28+ x86-64 Details for lance_nd-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl
lance_nd-0.1.0-cp310-abi3-manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.28+ ARM64 Details for lance_nd-0.1.0-cp310-abi3-manylinux_2_28_aarch64.whl
lance_nd-0.1.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for lance_nd-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
lance_nd-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for lance_nd-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 364.8 MB

Release files / lance_nd-0.1.0.tar.gz

Download URL lance_nd-0.1.0.tar.gz
Size 138.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f25ab7d931d79735d4e57ce5cea3c3cc938af2c3362fd4609f5f29eaeb236743
BLAKE2b-256 checksum
How to use checksums
b795d690db2c702dde3468938bd9b6abb328385e3b78db5f21883f9f0f82c8be
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 5, 2026.

Transparency log

Release files / lance_nd-0.1.0-cp310-abi3-win_amd64.whl

Download URL lance_nd-0.1.0-cp310-abi3-win_amd64.whl
Size 67.7 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
1d2242d88b560bd484976feea4ee530a85407a7b3158d685af035730bcd87b24
BLAKE2b-256 checksum
How to use checksums
79e282f29b7cfafcd61f715abd25bc1d977265258ba64212cef1c85c0bd4f41f
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 5, 2026.

Transparency log

Release files / lance_nd-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl

Download URL lance_nd-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl
Size 77.5 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
46cc5d7bdc8de5a20656665961f7ef4116be7d52c9fd7f6f36ab0e7603c8b09d
BLAKE2b-256 checksum
How to use checksums
3563f152c3bff0e18028d1e3543f9a053f6e07d142ffe442c0f9962211a5eb8f
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 5, 2026.

Transparency log

Release files / lance_nd-0.1.0-cp310-abi3-manylinux_2_28_aarch64.whl

Download URL lance_nd-0.1.0-cp310-abi3-manylinux_2_28_aarch64.whl
Size 80.3 MB
Tags CPython 3.10 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
d1397a7589dfe0976e95cc060c5f3e12570fe60c07edd3fe7825bdc8a0ef9b1d
BLAKE2b-256 checksum
How to use checksums
63022064d8a04ed9b868d5c73884a7b549150ea22cdcade8cd862278fb33b38f
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 5, 2026.

Transparency log

Release files / lance_nd-0.1.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL lance_nd-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
Size 67.9 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e115643c06711f4ba7db37520e953c34ac370fb203973b65189561a3176723e7
BLAKE2b-256 checksum
How to use checksums
1745a1138cf11c25e9a983ec32f787755e9291321b2dfe6a3874b3024ac5d3fe
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 5, 2026.

Transparency log

Release files / lance_nd-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl

Download URL lance_nd-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 71.1 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
8510af333b7715ef89b1441878655f6a7525df4cc6a43413db261d31dda0f28f
BLAKE2b-256 checksum
How to use checksums
4bd952e4fc8256cabbd60ccc3573adf602f8febc45ea0b2a06a9e43f355a3e42
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 5, 2026.

Transparency log

Security for lance-nd 0.1.0

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 lance_nd-0.1.0.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 5, 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.0 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