ensure_pickle_gz

ensure_pickle_gz(key: str, *subkeys: str, url: str, name: str | None = None, force: bool = False, download_kwargs: DownloadKwargs | None = None, mode: Literal['rb'] = 'rb', open_kwargs: Mapping[str, Any] | None = None, pickle_load_kwargs: Mapping[str, Any] | None = None) Any[source]

Download a gzipped pickle file and open with pickle.

Parameters:
  • key – The module name

  • subkeys – A sequence of additional strings to join. If none are given, returns the directory for this module.

  • url – The URL to download.

  • name – Overrides the name of the file at the end of the URL, if given. Also useful for URLs that don’t have proper filenames with extensions.

  • force – Should the download be done again, even if the path already exists? Defaults to false.

  • download_kwargs – Keyword arguments to pass through to pystow.utils.download().

  • mode – The read mode, passed to gzip.open()

  • open_kwargs – Additional keyword arguments passed to gzip.open()

  • pickle_load_kwargs – Keyword arguments to pass through to pickle.load().

Returns:

Any object