Re: Decoding a huge JSON file incrementally

2018-12-20 Thread Terry Reedy
On 12/20/2018 10:42 AM, Paul Moore wrote: I'm looking for a way to incrementally decode a JSON file. I know this has come up before, and in general the problem is not soluble (because in theory the JSON file could be a single object). AFAIK, a JSON file always represents a single JSON item and

Re: Decoding a huge JSON file incrementally

2018-12-20 Thread Chris Angelico
On Fri, Dec 21, 2018 at 4:30 AM Paul Moore wrote: > On Thu, 20 Dec 2018 at 17:22, Chris Angelico wrote: > > Proper error handling is left as an exercise for the reader, both in > > terms of JSON errors and file errors. Also, the code is completely > > untested. Have fun :) > > Yeah, once you have

Re: Decoding a huge JSON file incrementally

2018-12-20 Thread Paul Moore
(Sorry, hit "Send" too soon on the last try!) On Thu, 20 Dec 2018 at 17:22, Chris Angelico wrote: > > On Fri, Dec 21, 2018 at 2:44 AM Paul Moore wrote: > > > > I'm looking for a way to incrementally decode a JSON file. I know this > > has come up before, and in general the problem is not soluble

Re: Decoding a huge JSON file incrementally

2018-12-20 Thread Paul Moore
On Thu, 20 Dec 2018 at 17:22, Chris Angelico wrote: > > On Fri, Dec 21, 2018 at 2:44 AM Paul Moore wrote: > > > > I'm looking for a way to incrementally decode a JSON file. I know this > > has come up before, and in general the problem is not soluble (because > > in theory the JSON file could be

Re: Decoding a huge JSON file incrementally

2018-12-20 Thread Chris Angelico
On Fri, Dec 21, 2018 at 2:44 AM Paul Moore wrote: > > I'm looking for a way to incrementally decode a JSON file. I know this > has come up before, and in general the problem is not soluble (because > in theory the JSON file could be a single object). In my particular > situation, though, I have a

Decoding a huge JSON file incrementally

2018-12-20 Thread Paul Moore
I'm looking for a way to incrementally decode a JSON file. I know this has come up before, and in general the problem is not soluble (because in theory the JSON file could be a single object). In my particular situation, though, I have a 9GB file containing a top-level array object, with many eleme