module filehelper.decompress_helper
¶
Short summary¶
module pyensae.filehelper.decompress_helper
Various functions to decompress files
Functions¶
function |
truncated documentation |
---|---|
Decompresses a :epkg:`bz2` file. |
|
Decompresses a :epkg:`tar.gz` file. |
|
Decompresses a :epkg:`tar.gz` file. |
|
Unzips a :epkg:`zip` file. |
|
Extracts all members from the archive to the current working directory and set owner, modification time and permissions … |
Documentation¶
Various functions to decompress files
- pyensae.filehelper.decompress_helper.decompress_bz2(filename, whereTo='.', fLOG=<function noLOG>)¶
Decompresses a :epkg:`bz2` file.
- Parameters:
filename – file to process
folder – location of the result
fLOG – logging function
- Returns:
return the list of decompressed files (only one)
- pyensae.filehelper.decompress_helper.decompress_gz(filename, whereTo='.', fLOG=<function noLOG>)¶
Decompresses a :epkg:`tar.gz` file.
- Parameters:
filename – file to process
folder – location of the result
fLOG – logging function
- Returns:
return the list of decompressed files (only one)
- pyensae.filehelper.decompress_helper.decompress_targz(filename, whereTo='.', silent=True, fLOG=<function noLOG>)¶
Decompresses a :epkg:`tar.gz` file.
- Parameters:
filename – file to process
folder – location of the result
silent – raise a warning instead of an error
fLOG – logging function
- Returns:
return the list of decompressed files
- pyensae.filehelper.decompress_helper.decompress_zip(filename, whereTo='.', fLOG=<function noLOG>)¶
Unzips a :epkg:`zip` file.
- Parameters:
filename – file to process
whereTo – location of the result
fLOG – logging function
- Returns:
return the list of decompressed files
- pyensae.filehelper.decompress_helper.extractall_silent(self, path='.', members=None, *, numeric_owner=False, silent=False)¶
Extracts all members from the archive to the current working directory and set owner, modification time and permissions on directories afterwards. path’ specifies a different directory to extract to. `members’ is optional and must be a subset of the list returned by getmembers(). If `numeric_owner is True, only the numbers for user/group names are used and not the names.
Same function as TarFile.extractall but raises a warning if something wrong happens if silent is True.