pip install bsc
API mimics zlib
's
import bsc
assert b'1234' == bsc.decompress(bsc.compress(b'1234'))
# Incremental compressing
# Note that default block size is 25M, you'd better use it on
# very large streams
c = bsc.compressobj()
r = c.compress(b'1234')
r += c.compress(b'2345')
r += c.flush()
See Squash Benchmark