ICRAR / ijson

Iterative JSON parser with Pythonic interfaces
http://pypi.python.org/pypi/ijson/
Other
830 stars 51 forks source link

Is it possible to use isjon with Jsonl, ndjson ? #96

Closed dinhanhx closed 1 year ago

dinhanhx commented 1 year ago

Pretty much the title, For more context, please see https://jsonlines.org/ http://ndjson.org/

rtobar commented 1 year ago

Yes.

I'd appreciate you raised the issue with more information like the template suggests though, otherwise I don't know what you've tried (if you have tried anything at all) or why things aren't clear.

jpmckinney commented 1 year ago

It definitely works with JSONL and NDJSON. Just set multiple_values=True https://pypi.org/project/ijson/#options-1

Or, read one line at a time and pass each line to ijson. I do that so that I can parallelize parsing.

dinhanhx commented 1 year ago

Yes.

I'd appreciate you raised the issue with more information like the template suggests though, otherwise I don't know what you've tried (if you have tried anything at all) or why things aren't clear.

I'm sorry about that. I will follow the template.

dinhanhx commented 1 year ago

It definitely works with JSONL and NDJSON. Just set multiple_values=True https://pypi.org/project/ijson/#options-1

Or, read one line at a time and pass each line to ijson. I do that so that I can parallelize parsing.

Oh wow, I must have left that part out. Thanks

rtobar commented 1 year ago

Closing as the question has been clarified.