universal_pathlib icon indicating copy to clipboard operation
universal_pathlib copied to clipboard

Introduce a custom `StorageOptions` Mapping

Open ap-- opened this issue 4 months ago • 0 comments

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.

ap-- avatar Oct 18 '25 18:10 ap--