act.utils.unpack_tar#

act.utils.unpack_tar(tar_files, write_directory=None, temp_dir=False, randomize=True, return_files=True, remove=False)[source]#

Unpacks TAR file contents into provided base directory

Parameters:
  • tar_files (str or list) – path to TAR file to be unpacked

  • write_directory (str or pathlib.Path) – base path to extract contents of TAR files or create a new randomized directory to extract contents of TAR file.

  • temp_dir (boolean) – Should a temporary directory be created and TAR files extracted to the new directory. write_directory and randomize are ignored if this option is used.

  • randomize (boolean) – Create a new randomized directory to extract TAR files into.

  • return_files (boolean) – When set will return a list of full path filenames to the extracted files. When set to False will return full path to directory containing extracted files.

  • remove (boolean) – Delete provided TAR files after extracting files.

Returns:

files (list or str) – List of full path files extracted from the TAR file or full path to direcotry containing extracted files.