Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #50795 > unrolled thread

Re: [ANN]:JSONStream

Started by"Clark C. Evans" <cce@clarkevans.com>
First post2013-07-17 11:51 -0400
Last post2013-07-17 11:51 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [ANN]:JSONStream "Clark C. Evans" <cce@clarkevans.com> - 2013-07-17 11:51 -0400

#50795 — Re: [ANN]:JSONStream

From"Clark C. Evans" <cce@clarkevans.com>
Date2013-07-17 11:51 -0400
SubjectRe: [ANN]:JSONStream
Message-ID<mailman.4804.1374076304.3114.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

Looks interesting.  In YAML we used three dashes as the "stream
separator".

So already a YAML processor could handle a JSON stream ...



>>> for doc in yaml.load_all("""

... --- {"one": "value"}

... --- {"two": "another"}

... ---

... {"three": "a third item in the stream",

...  "with": "more data"}

... """):

...     print doc

...

{'one': 'value'}

{'two': 'another'}

{'with': 'more data', 'three': 'a third item in the stream'}

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web