pooch.Untar

class pooch.Untar(members=None)[source]

Processor that unpacks a tar archive and returns a list of all files.

Use with pooch.Pooch.fetch to untar a downloaded data file into a folder in the local data store. fetch will return a list with the names of the extracted files instead of the archive.

The output folder is {fname}.untar.

Parameters

members (list or None) – If None, will unpack all files in the archive. Otherwise, members must be a list of file names to unpack from the archive. Only these files will be unpacked.

Methods Summary

Untar.__call__(fname, action, pooch)

Extract all files from the given archive.


Untar.__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:

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