ensure_zip_np
- ensure_zip_np(key: str, *subkeys: str, url: str, inner_path: str, name: str | None = None, force: bool = False, download_kwargs: DownloadKwargs | None = None, load_kwargs: Mapping[str, Any] | None = None) numpy.typing.ArrayLike[source]
Download a zip file and open an inner file as an array-like with
numpy.- 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.
inner_path – The relative path to the file inside the archive
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().load_kwargs – Additional keyword arguments that are passed through to
read_zip_np()and transitively tonumpy.load().
- Returns:
An array-like object