reading *.lz4 file in python
<p>I have a huge number of tweet data that are compressed in lz4 formats. I'd like to open each file and decompress it, and extract some information from python. </p>

<p>When I decompress the file using <code>lz4c -d</code> command in Ubuntu, the file decompresses just fine. But when I use <code>lz4.loads('path_to_file')</code> in python, it complains that <code>ValueError: corrupt input at byte 6</code>. The same error message happens when I try to read() the file in bytes mode. What do I do? </p>

<p><code>lz4.loads()</code> decompresses the string you pass to it and not the file path in that string. It doesn't seem like this library supports opening files, so you have to read the data yourself.</p>

<pre><code>lz4.loads(open('path_to_file', 'rb').read())
</code></pre>

python lz4