def compressData(self, s):
    compressed = ''
begin = 0
blockSize = 1073741824
compressor = zlib.compressobj()
while begin < len(s):
    compressed = compressed + compressor.compress(s[begin:begin + blockSize])
begin = begin + blockSize
compressed = compressed + compressor.flush()
return compressed
Проблемы со сжатием больших данных в python