mirror of
https://github.com/google/brotli.git
synced 2026-07-08 17:56:58 +00:00
Python binding: add streaming compression / decompression support. #39
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rpasta42 on GitHub (Oct 1, 2015).
I'm trying to implement streaming compression using brotli. There's very little documentation and I haven't found anyone else trying to accomplish same thing. I assume I need to specify lgwin to set the block size, but when I run this code it gives me an error "brotli.error: BrotliDecompress failed"
my_str = 'very long string blah blah blah'
a = brotli.compress(my_str, lgwin=16)
b = brotli.decompress(a[0:16])
Am I doing something wrong or did I misunderstand the purpose of the lgwin parameter?
@eustas commented on GitHub (Oct 6, 2015):
Currently python brotli module doesn't support streaming compression/decompression.
lgwin is a parameter that is used to specify the length of LZ77 sliding window size.
Of course, streaming support will be eventually added to the Python bindings,... So stay tuned.
@Kijewski commented on GitHub (Mar 23, 2016):
Do you have a more precise ETA by now? More precise than "eventually" I mean.
@rpasta42 commented on GitHub (Apr 5, 2016):
I know C++ and Python, but have no familiarity with brotli codebase.
Where would I begin if I wanted to implement the Python binding for this?