zarr-sqlite-python
Store Zarr datasets in a single SQLite database.
zarr-sqlite is a Python library which provides SQLiteStore, a single-file store implementation
backed by SQLite for zarr-python. It combines Zarr's chunked, hierarchical data model with SQLite's single-file database format, mutability and ACID guarantees.
Why SQLiteStore?
- Single file — complete Zarr hierarchy is stored in one .zarrdb file.
- ACID transactions — writes are backed by SQLite's transactional database engine. A crash or power loss during a write cannot corrupt the entire file, at most, a single chunk may be lost. Readers can safely access the store concurrently with writers and are guaranteed to see a consistent view of the data.
- Mutable storage — arrays can be modified, overwritten, resized, appended to and deleted.
SQLiteStore is primarily intended for relatively small Zarr datasets (typically
up to a few gigabytes) where the convenience of a single file is useful for
archival, distribution, or sharing. It is not intended as an alternative to
cloud-based object storage designed for chunk-level access to multi-terabyte
datasets.
Installation
Install from PyPI using your favorite package manager, for example:
pip install zarr-sqlite
uv add zarr-sqlite
Quick start
import zarr
from zarr_sqlite import SQLiteStore
with SQLiteStore("my_zarr_file.zarrdb") as store:
root = zarr.create_group(store=store)
foo = root.create_group("foo")
bar = foo.create_group("bar")
z1 = bar.create_array(name="baz", shape=(10000, 10000), chunks=(1000, 1000), dtype="int32")
z1[:] = 42
SQLiteStore otherwise behaves identically to other stores used with zarr.
See the zarr-python user guide
for more information.
Documentation
There isn't much more to using SQLiteStore as it "just works" with
zarr-python. Full API reference can be accessed by running uv run pdoc -d numpy (or just doc if you have just installed).
A copy of the API documentation for the current main branch is also hosted here:
How it works
SQLiteStore implements the abstract store
interface
defined by the Zarr Core Specification, which essentially provides a key-value
storage interface. It maps this interface directly onto a SQLite table, using
string keys and binary BLOB values. Keys correspond to Zarr paths, while values
contain either array chunks or Zarr metadata items. SQLite then provides the
persistence and transactional semantics underneath the Zarr store.
Specification
The file format is described by a specification stored in this project's repository. This document should allow the implementation of SQLiteStore for other programming languages or Zarr libraries.
Status
The version of this library was incremented to v1.0 to reflect the fact that it complies with v1 of the SQLiteStore Specification. However, this is a relatively young library that has not seen a lot of real-world use yet, therefore users should expect the occasional bug, and possibly breaking API changes in future versions, if absolutely necessary.
The database format defined by the Specification is intended to provide a stable basis for interoperability between implementations.
Metadata
Release files for zarr-sqlite 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| zarr_sqlite-1.0.1.tar.gz | 11.9 kB | Without provenance | Details for zarr_sqlite-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| zarr_sqlite-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for zarr_sqlite-1.0.1-py3-none-any.whl |
Total release size: 28.1 kB
Release files / zarr_sqlite-1.0.1.tar.gz
| Download URL | zarr_sqlite-1.0.1.tar.gz |
|---|---|
| Size | 11.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9ec68f76ecc1a2ad763c24fae567ff2d21b16a8d61560d3e0f129f03a0788d08
|
|
BLAKE2b-256 checksum How to use checksums |
7ffa9ddd8163aceab88bcb0fbcaa169e16f3e25ba03a202b44ead3be20c4ca09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / zarr_sqlite-1.0.1-py3-none-any.whl
| Download URL | zarr_sqlite-1.0.1-py3-none-any.whl |
|---|---|
| Size | 16.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4be4ca836924dc7ceee0941b2c6272d93de473b79033b415990c66e6a1d108bb
|
|
BLAKE2b-256 checksum How to use checksums |
647042a1b7bfc1ff8c9a2ac0b86eb91fa0667e1494b2373f6782cb68422038bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for zarr-sqlite 1.0.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.