Skip to content

Instantly share code, notes, and snippets.

View fabianschwarzfritz's full-sized avatar
👷‍♂️

Fabian Schwarz-Fritz fabianschwarzfritz

👷‍♂️
View GitHub Profile
@ozanturksever
ozanturksever / get_uncompressed_size.py
Last active August 25, 2020 14:10
python get uncompressed size of a .gz file
def get_uncompressed_size(self, file):
fileobj = open(file, 'r')
fileobj.seek(-8, 2)
crc32 = gzip.read32(fileobj)
isize = gzip.read32(fileobj) # may exceed 2GB
fileobj.close()
return isize