2

I am downloading files from the web with the ending .xz. It says they are JSONstrean files.

Is there a way to read these files in Python, for example like a CSV file?

gython
  • 865
  • 4
  • 18

1 Answers1

3

Python has a library lzma for Reading and writing compressed files

Here is a simple running code

import lzma
with lzma.open('filename.xz', mode='rt') as file:
    for line in file:
       print(line)