Metadata-Version: 2.4
Name: aimip-intake-icechunk
Version: 0.1.0
Summary: Classic-Intake driver for icechunk virtual stores; AIMIP-friendly defaults but reusable.
Author: AIMIP catalog contributors
License: MIT
Project-URL: Homepage, https://github.com/koldunovn/aimip-intake-icechunk
Project-URL: Issues, https://github.com/koldunovn/aimip-intake-icechunk/issues
Project-URL: Source, https://github.com/koldunovn/aimip-intake-icechunk
Keywords: intake,icechunk,zarr,xarray,virtualizarr,cmip6,aimip
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: icechunk>=2
Requires-Dist: intake>=2
Requires-Dist: xarray
Requires-Dist: zarr>=3
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Dynamic: license-file

# aimip-intake-icechunk

A small classic-[Intake](https://intake.readthedocs.io/) driver that opens [icechunk](https://icechunk.io/) repositories as `xarray.Dataset`s. Defaults are tuned for the AIMIP catalog on DKRZ S3, but the driver is general — point it at any icechunk repo (local path, `file://` URL, or `s3://...`).

```python
import intake

# YAML catalog references it as
#   driver: aimip_intake_icechunk.IcechunkSource
#   args:
#     urlpath: s3://your-bucket/path/to/icechunk-repo
cat = intake.open_catalog("path/to/catalog.yaml")
ds = cat['my_store'].to_dask()
```

Or directly in Python:

```python
from aimip_intake_icechunk import IcechunkSource

src = IcechunkSource(urlpath="s3://ai-mip/catalog/CMIP6/AIMIP/NVIDIA/cBottle-1-3/aimip/r1i1p4f1/Amon/gn")
ds = src.to_dask()
```

## Why a separate package

Consumers of the [aimip-data](https://github.com/koldunovn/aimip-data) catalog who only need read access shouldn't have to install the build-time machinery (VirtualiZarr, icechunk's writers, the facet parser, the scanner, the YAML emitter, etc.). This driver is ~150 lines and depends only on `icechunk`, `intake`, `xarray`, `zarr`.

## Install

```bash
pip install aimip-intake-icechunk
```

Or from a checkout of the [aimip-data](https://github.com/koldunovn/aimip-data) repo:

```bash
pip install -e packages/aimip-intake-icechunk
```

## Defaults

For convenience, the driver defaults to the AIMIP layout:

| Default | Value |
|---|---|
| `s3_options.endpoint_url` | `https://s3.eu-dkrz-1.dkrz.cloud` |
| `s3_options.anonymous` | `True` |
| `s3_options.force_path_style` | `True` |
| `virtual_chunk_auth` | `{"s3://ai-mip/": None}` (anonymous) |

Override at construction time for other deployments:

```python
IcechunkSource(
    urlpath="s3://my-bucket/repo",
    s3_options={"endpoint_url": "https://s3.amazonaws.com", "anonymous": False},
    virtual_chunk_auth={"s3://my-bucket/": my_credentials},
)
```

## License

MIT.
