Skip to main content

Dataframe-agnostic Zarr storage powered by Narwhals

Project description

zarrwhals

Package PyPI Python License
CI/CD Tests Build codecov CodSpeed
Docs & Tools Docs Ruff uv

Dataframe-agnostic Zarr storage powered by Narwhals

Overview

Zarrwhals provides a simple API for storing DataFrames in Zarr format, using Narwhals for DataFrame interoperability. Inspired by AnnData's approach to storing obs/var DataFrames as Zarr Stores.

Quick Start

import pandas as pd
import zarrwhals as zw

# Create a DataFrame
df = pd.DataFrame({
    "id": [1, 2, 3],
    "name": ["Alice", "Bob", "Charlie"],
    "value": [10.5, 20.3, 30.1],
    "category": pd.Categorical(["A", "B", "A"])
})

# Write to Zarr
zw.to_zarr(df, "data.zarr")

# Read back
df_loaded = zw.from_zarr("data.zarr")

With Polars

import polars as pl
import zarrwhals as zw

# Write polars DataFrame
df_pl = pl.DataFrame({
    "a": [1, 2, 3],
    "b": ["x", "y", "z"]
})
zw.to_zarr(df_pl, "data.zarr")

# Read as pandas
df_pd = zw.from_zarr("data.zarr", backend="pandas")

# Or read back as polars
df_pl2 = zw.from_zarr("data.zarr", backend="polars")

Getting started

Please refer to the documentation, in particular, the API documentation.

Installation

You need to have Python 3.11 or newer installed on your system. If you don't have Python installed, we recommend installing uv.

There are several alternative options to install zarrwhals:

  1. Install the latest development version:
pip install git+https://github.com/srivarra/zarrwhals.git@main

Release notes

See the changelog.

Contact

For questions and help requests, you can reach out in the scverse discourse. If you found a bug, please use the issue tracker.

Citation

t.b.a

Project details


Download files

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

Source Distribution

zarrwhals-0.0.1.tar.gz (30.3 kB view details)

Uploaded Source

Built Distribution

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

zarrwhals-0.0.1-py3-none-any.whl (56.4 kB view details)

Uploaded Python 3

File details

Details for the file zarrwhals-0.0.1.tar.gz.

File metadata

  • Download URL: zarrwhals-0.0.1.tar.gz
  • Upload date:
  • Size: 30.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for zarrwhals-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c73abcb10199e2e17705fb376236b4b3824f6ea8836839de6b68c70a97a52fd9
MD5 c6b618163a6578ad880727f6ba4f9727
BLAKE2b-256 9575dd95e87ea34fc27dd85d978a1fc145fead85a8d3d8bc027c5b37f58f913c

See more details on using hashes here.

Provenance

The following attestation bundles were made for zarrwhals-0.0.1.tar.gz:

Publisher: release.yaml on srivarra/zarrwhals

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

File details

Details for the file zarrwhals-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: zarrwhals-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 56.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for zarrwhals-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b1cc34fc90814b047254a5b2aeb9e1f2d6bae935a91297675ec0c059001636b2
MD5 81f89865ba02df26a8bb417f415bab6a
BLAKE2b-256 b737d4f7f4911d79ab821df455bf756dd57c00f3523b6b0fbdbed000d0581c9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for zarrwhals-0.0.1-py3-none-any.whl:

Publisher: release.yaml on srivarra/zarrwhals

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page