Skip to main content

Read only Zarr storage

Project description

sferriol-zarr

sferriol-zarr is a module with new zarr storage class TarStore (only read-only).

It also has the create_store shortcut that returns the store corresponding to the specified url

Installation

pip install git+https://gitlab.in2p3.fr/sferriol-ip2i/sferriol-zarr.git

TarStore Usage

import zarr
import sferriol.zarr

# original zarr storage

dir_store =  zarr.DirectoryStore('data/example.zarr')
z = zarr.create(store=dir_store, overwrite=True, shape=1000000, dtype='i4')


# convert it to tar file ('data/example.zarr.tar')

tar_fpath = sferriol.zarr.create_tar('data/example.zarr')


# now use TarStore

tar_store =  sferriol.zarr.TarStore('data/example.zarr.tar')
tz = zarr.open(store=tar_store, mode='r')
tar_store.close()  # don't forget to call this when you're done


# or in a with statement

with sferriol.zarr.TarStore('data/example.zarr.tar') as tar_store:
    tz = zarr.open(store=tar_store, mode='r')

create_store Usage

from sferriol.zarr import create_store

# local storage

store = create_store('/.../my_data.zarr')
store = create_store('/.../my_data.zarr.tar')
store = create_store('/.../my_data.zarr.zip')

# xrootd storage

store = create_store('root://host:port///.../my_data.zarr')
store = create_store('root://host:port///.../my_data.zarr.tar')
store = create_store('root://host:port///.../my_data.zarr.zip')

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

sferriol_zarr-0.4.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file sferriol_zarr-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: sferriol_zarr-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for sferriol_zarr-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a91c7f0e3c2befe4d9b3f34fe4d4f11652e88af700712153fabfeb599aad05da
MD5 8b5ee70e975ca1b8197152c7476eaeb4
BLAKE2b-256 a6dcf4626cdf14c5df56e41e55f3a810b246336cc4758773ffe7977f8bb42ca8

See more details on using hashes here.

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