pooch.Unzip¶
-
class
pooch.
Unzip
(members=None)[source]¶ Processor that unpacks a zip archive and returns a list of all files.
Use with
pooch.Pooch.fetch
to unzip a downloaded data file into a folder in the local data store.fetch
will return a list with the names of the unzipped files instead of the zip archive.The output folder is
{fname}.unzip
.Parameters: - members : list or None
If None, will unpack all files in the zip archive. Otherwise, members must be a list of file names to unpack from the archive. Only these files will be unpacked.
Methods
__call__
(self, fname, action, pooch)Extract all files from the given archive.
-
Unzip.
__call__
(self, fname, action, pooch)¶ Extract all files from the given archive.
Parameters: - fname : str
Full path of the zipped file in local storage.
- action : str
Indicates what action was taken by
pooch.Pooch.fetch
. One of:"download"
: The file didn’t exist locally and was downloaded"update"
: The local file was outdated and was re-download"fetch"
: The file exists and is updated so it wasn’t downloaded
- pooch :
pooch.Pooch
The instance of
pooch.Pooch
that is calling this.
Returns: - fnames : list of str
A list of the full path to all files in the extracted archive.