| 1 |
|
| 2 |
kerchunk |
| 3 |
======== |
| 4 |
|
| 5 |
Kerchunk is a library that provides a unified way to represent a variety of chunked, compressed data formats |
| 6 |
(e.g. NetCDF/HDF5, GRIB2, TIFF, ...), |
| 7 |
allowing efficient access to the data from traditional file systems or cloud object storage. |
| 8 |
It also provides a flexible way to create |
| 9 |
virtual datasets from multiple files. It does this by extracting the byte ranges, |
| 10 |
compression information and other information about the |
| 11 |
data and storing this metadata in a new, separate object. This means that you can |
| 12 |
create a virtual aggregate dataset over potentially many source |
| 13 |
files, for efficient, parallel and cloud-friendly *in-situ* access without having to copy or |
| 14 |
translate the originals. It is a gateway to in-the-cloud massive data processing while |
| 15 |
the data providers still insist on using legacy formats for archival storage. |
| 16 |
|
| 17 |
*Why Kerchunk*: |
| 18 |
|
| 19 |
We provide the following things: |
| 20 |
|
| 21 |
- completely serverless architecture |
| 22 |
- metadata consolidation, so you can understand a many-file dataset (metadata plus physical storage) in a single read |
| 23 |
- read from all of the storage backends supported by fsspec, including object storage (s3, gcs, abfs, alibaba), http, |
| 24 |
cloud user storage (dropbox, gdrive) and network protocols (ftp, ssh, hdfs, smb...) |
| 25 |
- loading of various file types (currently netcdf4/HDF, grib2, tiff, fits, zarr), potentially heterogeneous within a |
| 26 |
single dataset, without a need to go via the specific driver (e.g., no need for h5py) |
| 27 |
- asynchronous concurrent fetch of many data chunks in one go, amortizing the cost of latency |
| 28 |
- parallel access with a library like zarr without any locks |
| 29 |
- logical datasets viewing many (>~millions) data files, and direct access/subselection to them via coordinate |
| 30 |
indexing across an arbitrary number of dimensions |
| 31 |
|
| 32 |
|
| 33 |
Introduction |
| 34 |
------------ |
| 35 |
|
| 36 |
This library was created to solve the problem of reading existing scientific datatypes as efficiently as possible in the cloud. The amount of observed and simulated data |
| 37 |
is now too large to be handled effectively via download and local processing. In the cloud era, the answer is to move compute to the data in the Cloud, process in |
| 38 |
parallel, and access the data *in situ*, and only as much as needed to solve a problem or use case. |
| 39 |
|
| 40 |
Datasets are stored in many different file formats, and often as collections of files. |
| 41 |
Many of these formats are designed for on-premises filesystems and are hard or inefficient |
| 42 |
to use seamlessly in the cloud. |
| 43 |
|
| 44 |
For binary storage of array data, essentially all formats involve taking blocks of in-memory |
| 45 |
C buffers and encoding/compressing them to disc, with some additional metadata describing |
| 46 |
the details of that buffer plus any other attributes. This description can be applied to a |
| 47 |
very wide variety of data formats. |
| 48 |
|
| 49 |
The primary purpose of ``kerchunk`` is to find where these binary blocks are, and how to decode them, |
| 50 |
so that blocks from one or more files can be arranged into aggregate datasets accessed via the |
| 51 |
`zarr`_ library and the power of `fsspec`_. To understand how this works, please read |
| 52 |
:doc:`detail`. Or consider the PyData talk: `All You Need Is Zarr`_. |
| 53 |
|
| 54 |
|
| 55 |
.. _zarr: https://zarr.readthedocs.io/en/stable/ |
| 56 |
.. _fsspec: https://filesystem-spec.readthedocs.io/en/latest/ |
| 57 |
.. _All You Need Is Zarr: https://www.youtube.com/watch?v=0bqpxX3Nn_A |
| 58 |
|
| 59 |
.. toctree:: |
| 60 |
:maxdepth: 2 |
| 61 |
:caption: Contents: |
| 62 |
|
| 63 |
test_example |
| 64 |
tutorial |
| 65 |
detail |
| 66 |
cases |
| 67 |
spec |
| 68 |
beyond |
| 69 |
nonzarr |
| 70 |
reference |
| 71 |
reference_aggregation |
| 72 |
contributing |
| 73 |
advanced |
| 74 |
code-of-conduct |
| 75 |
|
| 76 |
Indices and tables |
| 77 |
================== |
| 78 |
|
| 79 |
* :ref:`genindex` |
| 80 |
* :ref:`modindex` |
| 81 |
* :ref:`search` |