Package pysys :: Package utils :: Module fileunzip
[hide private]
[frames] | no frames]

Module fileunzip

source code

Functions [hide private]
 
unzipall(path, binary=False)
Unzip all .gz files in a given directory.
source code
 
unzip(zfilename, replace=False, binary=False)
Unzip a .gz archive and write the contents to disk.
source code
Variables [hide private]
  __package__ = 'pysys.utils'
Function Details [hide private]

unzipall(path, binary=False)

source code 

Unzip all .gz files in a given directory.

Parameters:
  • path - The full path to the directory containing the archive files
  • binary - Boolean flag to indicate if the unzipped files should be written as binary
Raises:

unzip(zfilename, replace=False, binary=False)

source code 

Unzip a .gz archive and write the contents to disk.

The method will unpack a file of the form file.data.gz to file.data, removing the archive file in the process if the replace input parameter is set to true. By default the unpacked archive is written as text data, unless the binary input parameter is set to true, in which case the unpacked file is written as binary.

Parameters:
  • zfilename - The full path to the archive file
  • replace - Boolean flag to indicate if the archive file should be removed after unpacking
  • binary - Boolean flag to indicate if the unzipped file should be written as binary
Raises:
  • FileNotFoundException - Raised if the archive file does not exist
  • IncorrectFileTypeEception - Raised if the archive file does not have a .gz extension