Skip to content

Instantly share code, notes, and snippets.

@jacks0n9
Created July 7, 2021 23:20
Show Gist options
  • Save jacks0n9/77170aae78c4a7cd220571190fdb076f to your computer and use it in GitHub Desktop.
Save jacks0n9/77170aae78c4a7cd220571190fdb076f to your computer and use it in GitHub Desktop.
This is a simple script that reads a jsonlines file and parses it into an array. Feel free to steal this function and paste it into your own code.
import json
def parse_jsonl(filename):
lines=[]
with open(filename,"r") as file:
data=file.readlines()
for line in data:
lines.append(json.loads(line))
return lines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment