Key encoding for dbm-style databases #133
Labels
enhancement
New features or improvements
release notes done
Automatically applied to PRs which have release notes.
Milestone
There are a number of embedded key-value stores available, including the built-in dbm-style databases provided by the Python standard library, as well as BerkeleyDB and Kyoto Cabinet. These provide a
MutableMapping
interface but generally expect keys to be bytes objects not strings, and will return bytes objects when asked for an iterator over keys. Zarr uses text strings for keys currently, and so these key-value databases cannot be used directly with Zarr, however it would be nice and should be straighforward to provide some support.There are two options. (1) Provide a
MutableMapping
wrapper class that performs key encoding/decoding (e.g., 'zarr.storage.KeyValueStore' or 'zarr.storage.DbmStore'). (2) Add akey_encoding
option to theArray
andGroup
classes, which would beNone
by default (preserving current behaviour to use text strings as keys) but if not None would be used to encode and decode keys outside of the store.The text was updated successfully, but these errors were encountered: