Currently we rely on types.MappingProxyType to return storage_options as a read-only mapping under the .storage_options property. It would be a nice addition if we'd introduce a StorageOptions mapping class that would provide convenience methods for specific conversions:
.to_unchained()
This style is supported by fsspec.open() where for a chained urlpath, every filesystem's options are provided under the corresponding protocol key. I.e.
"zip::file://tmp/archive.zip", {"zip": {'some': 'option'}, "file": {'another': 'option'}}
.to_object_store()
This could be used to translate to object_store storage_options from s3fs, az, and gcsfs storage options, and would be interesting for use with polars, and all the other rust tools.
We could also add a nicer __repr__ with a pretty formatted dict.
Currently we rely on
types.MappingProxyTypeto return storage_options as a read-only mapping under the.storage_optionsproperty. It would be a nice addition if we'd introduce aStorageOptionsmapping class that would provide convenience methods for specific conversions:.to_unchained()This style is supported by
fsspec.open()where for a chained urlpath, every filesystem's options are provided under the corresponding protocol key. I.e..to_object_store()This could be used to translate to
object_storestorage_options froms3fs,az, andgcsfsstorage options, and would be interesting for use with polars, and all the other rust tools.We could also add a nicer
__repr__with a pretty formatted dict.