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 or pooch.retrieve to unzip a downloaded data file into a folder in the local data store. The method/function 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 Summary

Unzip.__call__(fname, action, pooch)

Extract all files from the given archive.


Unzip.__call__(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 or pooch.retrieve:

    • "download": File didn’t exist locally and was downloaded

    • "update": Local file was outdated and was re-download

    • "fetch": 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.