{"id":28467,"library":"xarray-tensorstore","title":"xarray-tensorstore","description":"Provides xarray backends for reading and writing N-dimensional arrays via TensorStore, enabling distributed and chunked access to Zarr, N5, and other stores. Current version: 0.3.0, release cadence: irregular.","status":"active","version":"0.3.0","language":"python","source_language":"en","source_url":"https://github.com/google/xarray-tensorstore","tags":["xarray","tensorstore","zarr","array","io","distributed"],"install":[{"cmd":"pip install xarray-tensorstore","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Core dependency for xarray integration","package":"xarray","optional":false},{"reason":"Required for TensorStore I/O backends","package":"tensorstore","optional":false}],"imports":[{"note":"TensorStoreBackend is not in xarray.backends; incorrect import leads to ModuleNotFoundError.","wrong":"from xarray.backends import TensorStoreBackend","symbol":"tensorstore_backend","correct":"from xarray.tensorstore import TensorStoreBackend"}],"quickstart":{"code":"import xarray as xr\nimport os\n\n# Open a TensorStore-backed Zarr store\nstore_url = '/tmp/test.zarr'\nds = xr.open_zarr(store_url, backend='tensorstore')\nprint(ds)\n\n# Write with TensorStore backend\nds = xr.Dataset({'var': (('x',), [1,2,3])})\nds.to_zarr(store_url, backend='tensorstore')","lang":"python","description":"Open and write Zarr datasets using the TensorStore backend."},"warnings":[{"fix":"Always include backend='tensorstore' in open_zarr() or to_zarr() calls.","message":"The tensorstore backend requires explicit specification via 'backend' keyword. Without it, xarray defaults to zarr-python backend.","severity":"gotcha","affected_versions":"0.1.0+"},{"fix":"Use 'from xarray.tensorstore import TensorStoreBackend' instead of 'from xarray.contrib.tensorstore import ...'","message":"In version 0.3.0, the import path changed from xarray.contrib.tensorstore to xarray.tensorstore. Existing code using the old import will break.","severity":"breaking","affected_versions":"0.3.0"},{"fix":"Use backend_kwargs={'open': {...}} instead of tensorstore_kwargs={'open': {...}}","message":"The 'tensorstore_kwargs' argument in open_zarr is deprecated in favor of passing kwargs via 'backend_kwargs'.","severity":"deprecated","affected_versions":"0.2.0 - 0.3.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Install xarray-tensorstore: pip install xarray-tensorstore. Then import xarray before using the backend.","cause":"xarray-tensorstore is not installed or the import hook didn't register the backend.","error":"ValueError: unrecognized backend 'tensorstore'. Must be one of: ..."},{"fix":"Use 'from xarray.tensorstore import TensorStoreBackend' instead.","cause":"Import path changed in version 0.3.0.","error":"ModuleNotFoundError: No module named 'xarray.contrib.tensorstore'"},{"fix":"Use backend_kwargs parameter: xr.open_zarr(..., backend='tensorstore', backend_kwargs={'open': {'k1': 'v1'}})","cause":"tensorstore_kwargs was removed in version 0.3.0.","error":"TypeError: open_zarr() got an unexpected keyword argument 'tensorstore_kwargs'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}