This module contains convenience functions for general file handling.
Temporarily decompress file for reading.
Returns the full path to the uncompressed temporary file or the original filename if it was not compressed.
Supported compression formats are: gzip, bzip2, zip, and lzma (Python 3.3 or newer only).
This function is tailored for use in a with statement. It uses a context manager to automatically remove the decompressed file after use.
Generator containing the path to the input filename.
>>> tmpdir = '/tmp' >>> with typhon.files.decompress('datafile.nc.gz', tmpdir) as file: >>> f = netCDF4.Dataset(file) >>> #...