Quantcast
Channel: python: how do I parse a stream of json arrays with ijson library - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by bbc for python: how do I parse a stream of json arrays with ijson...

You can use json.JSONDecoder.raw_decode to walk through the string. Its documentation indeed says: This can be used to decode a JSON document from a string that may have extraneous data at the end. The...

View Article



Answer by alexanderbird for python: how do I parse a stream of json arrays...

Here's a first cut at the problem that at least has a working regex substitution to turn a full string into valid json. It only works if you're ok with reading the full input stream before parsing as...

View Article

python: how do I parse a stream of json arrays with ijson library

The incoming data resembles the following: [{ "foo": "bar" }] [{ "bar": "baz" }] [{ "baz": "foo" }] as you see, arrays of objects strung together. JSON-ish ijson is able to handle the first array, and...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images