python-lz4 icon indicating copy to clipboard operation
python-lz4 copied to clipboard

Streaming API

Open oberstet opened this issue 12 years ago • 8 comments

It would be awesome to have streaming compressor/decompressor API as with zlib.compressobj and zlib.decompressobj.

Even more useful would be: being able to set any configuration on the compressor/decompressor objects, like i.e. HC mode and such.

oberstet avatar Jun 09 '13 17:06 oberstet

:+1:

tsileo avatar Jun 17 '13 12:06 tsileo

Yes – and specifically, to be able to create or read arbitrarily-large ".lz4" files created by the lz4 command-line. I believe in practice that would mean supporting this: https://docs.google.com/document/d/1cl8N1bmkTdIpPLtnlzbBSFAdUeyNo5fwfHbHU7VRNWY/edit

Can anyone confirm that's what's needed and that it doesn't already exist?

gojomo avatar Jun 22 '15 18:06 gojomo

So far I wasn't able to find any lz4 library that supports streaming, and especially for large files it's a requirement.

dreamflasher avatar Mar 02 '17 08:03 dreamflasher

What about : http://lz4.github.io/lz4/#interoperable-lz4 ?

Cyan4973 avatar Mar 02 '17 18:03 Cyan4973

I checked out the two in that site and a couple more, but no currently none supports streaming/linewise iteration.

dreamflasher avatar Mar 02 '17 18:03 dreamflasher

Interesting, both these projects announce streaming capabilities for large files, though it could be different from what you are looking for exactly. Little details matter.

Cyan4973 avatar Mar 02 '17 18:03 Cyan4973

The project at github.com/python-lz4 continues this work. We have added frame support, and streaming support is planned for the future.

jonathanunderwood avatar Mar 02 '17 18:03 jonathanunderwood

@Cyan4973 They support the LZ4 streaming (frame?) interface, but they don't do that in a way that it's compatible with Python bytestreams (io.RawIOBase).

dreamflasher avatar Mar 02 '17 19:03 dreamflasher