ensure_zip_np
- ensure_zip_np(key, *subkeys, url, inner_path, name=None, force=False, download_kwargs=None, load_kwargs=None)[source]
Download a zip file and open an inner file as an array-like with
numpy
.- Parameters:
key (
str
) – The module namesubkeys (
str
) – A sequence of additional strings to join. If none are given, returns the directory for this module.url (
str
) – The URL to download.inner_path (
str
) – The relative path to the file inside the archivename (
Optional
[str
]) – 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 (
bool
) – Should the download be done again, even if the path already exists? Defaults to false.download_kwargs (
Optional
[Mapping
[str
,Any
]]) – Keyword arguments to pass through topystow.utils.download()
.load_kwargs (
Optional
[Mapping
[str
,Any
]]) – Additional keyword arguments that are passed through toread_zip_np()
and transitively tonumpy.load()
.
- Return type:
Union
[_SupportsArray
[dtype
],_NestedSequence
[_SupportsArray
[dtype
]],bool
,int
,float
,complex
,str
,bytes
,_NestedSequence
[Union
[bool
,int
,float
,complex
,str
,bytes
]]]- Returns:
An array-like object