def gunzip_stream(fileobj, bufsize=1024):
 READ_GZIP_DATA = 16
 d = zlib.decompressobj((READ_GZIP_DATA | zlib.MAX_WBITS))
 while True:
  chunk = fileobj.read(bufsize)
  if (not chunk):
   return
  data = d.decompress(chunk)
  if data:
   (yield data)

def gunzip_stream ( fileobj , bufsize = 1024 ) : READ_GZIP_DATA = 16 d = zlib . decompressobj ( ( READ_GZIP_DATA | zlib . MAX_WBITS ) ) while True : chunk = fileobj . read ( bufsize ) if ( not chunk ) : return data = d . decompress ( chunk ) if data : ( yield data )
decompress gzipped data on the fly .