Reads and parses the input of a jsonl file stream or file. Jsonl formatted files must have a single valid json value on each line which is parsed by the python json module. >>> seq.jsonl('examples/chat_logs.jsonl').first() {u'date': u'10/09', u'message': u'
(self, jsonl_file)
| 190 | return self(csv_input).cache(delete_lineage=True) |
| 191 | |
| 192 | def jsonl(self, jsonl_file): |
| 193 | """ |
| 194 | Reads and parses the input of a jsonl file stream or file. |
| 195 | |
| 196 | Jsonl formatted files must have a single valid json value on each line which is parsed by |
| 197 | the python json module. |
| 198 | |
| 199 | >>> seq.jsonl('examples/chat_logs.jsonl').first() |
| 200 | {u'date': u'10/09', u'message': u'hello anyone there?', u'user': u'bob'} |
| 201 | |
| 202 | :param jsonl_file: path or file containing jsonl content |
| 203 | :return: Sequence wrapping jsonl file |
| 204 | """ |
| 205 | if isinstance(jsonl_file, str): |
| 206 | file_open = get_read_function(jsonl_file, self.disable_compression) |
| 207 | input_file = file_open(jsonl_file) |
| 208 | else: |
| 209 | input_file = jsonl_file |
| 210 | return self(input_file).map(jsonapi.loads).cache(delete_lineage=True) |
| 211 | |
| 212 | def json(self, json_file): |
| 213 | """ |