Skip to main content

Recompress zarr chunks in-place

Project description

mysquishy

"I shall call him Squishy and he shall be mine and he shall be my Squishy." — Dory

mysquishy

Change the compression of a zarr array in-place.

This works by loading the chunk bytes, decoding them, recoding them, and saving them. At the end, the .zarray file at the root is updated.

Note that this only works for single arrays: there should be a .zarray file at the root. It is left as an exercise for the reader to figure out how to recompress every array in a zarr group.

Contributions are very welcome.

⚠️ BAD SQUISHY! ⚠️

Bad Squishy!

This is currently just a proof of concept and it will leave your zarr arrays in an inconsistent/broken state if it is interrupted! And/or there might be bugs. It makes no effort to account for missing keys, for example. As above, contributions are very welcome but in the meantime be careful! Make a tiny zarr example similar to your data and check that it works fine there before deploying it properly.

Usage

From Python:

nbytes_before, nbytes_after = mysquishy.squish('path/to/array.zarr')

From the command line:

mysquishy path/to/array.zarr

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

mysquishy-0.1.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

mysquishy-0.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file mysquishy-0.1.0.tar.gz.

File metadata

  • Download URL: mysquishy-0.1.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.5

File hashes

Hashes for mysquishy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 23347c2ad340b2b10999e9a05a8e8d37769c747e2c1dbc8d5c17f20036d4c8c3
MD5 64c68b8479864960aa44eeed076a0445
BLAKE2b-256 119acdf599d1fa4e605125350db4e019068620b091d93c1f16e9ec8f2328aea4

See more details on using hashes here.

File details

Details for the file mysquishy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mysquishy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.5

File hashes

Hashes for mysquishy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae2c1fc6ab1ddc2c6034e7c63444f102528041f90aad94f31bd4ba5675a8a32b
MD5 a371d249f1ff594d071b56e58e999094
BLAKE2b-256 e6b604aaae646c52c166635e366a299094bd4b8130872fd2aa0d9ede5743dbd8

See more details on using hashes here.

Supported by

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