python-snappy
python-snappy copied to clipboard
A way to specify offset/length when compressing and uncompressing
If I want to compress or uncompress only a view of my string/data, I don't see a way to do that without creating a copy. Do you think this can be added.
Have you considered using memoryview as a pure-python way to implement this?
Yes. It gives the following error: exceptions.TypeError: must be string or read-only buffer, not memoryview
I see, sorry to hear that. Ideally it ought to work with memoryviews, but I see that the code is written in a pretty py2 kind of style. Allowing an offset parameter doesn't sound too hard to implement, but I don't quite know how, I didn't write the original code. Perhaps an extra parameter to here?