watex.utils.funcutils.zip_extractor#

watex.utils.funcutils.zip_extractor(zip_file, samples='*', ftype=None, savepath=None, pwd=None)[source]#

Extract ZIP archive objects.

Can extract all or a sample objects when the number of object is passed to the parameter samples.

New in version 0.1.5.

Parameters:
  • zip_file (str) – Full Path to archive Zip file.

  • samples (int, str, default ='*') – Number of data to retrieve from archive files. This is useful when the archive file contains many data. * means extract all.

  • savepath (str, optional) – Path to store the decompressed archived files.

  • ftype (str,) – Is the extension of a specific file to decompressed. Indeed, if the archived files contains many different data formats, specifying the data type would retrieved this specific files from the whole files archieved.

  • pwd (int, optional) – Password to pass if the zip file is encrypted.

Returns:

objnames – List of decompressed objects.

Return type:

list,

Examples

>>> from watex.utils.funcutils import zip_extractor
>>> zip_extractor ('watex/datasets/data/edis/e.E.zip')