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


Groups > comp.lang.python > #50795

Re: [ANN]:JSONStream

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <cce@clarkevans.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:: [': 0.04; 'json': 0.07; 'subject:ANN': 0.07; 'received:internal': 0.09; 'dashes': 0.16; 'message-id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:messagingengine.com': 0.16; 'yaml': 0.16; '>>>': 0.22; 'print': 0.22; '&gt;&gt;&gt;': 0.24; 'processor': 0.24; 'looks': 0.24; '---': 0.24; 'header:In-Reply-To:1': 0.27; 'doc': 0.31; 'third': 0.33; 'could': 0.34; 'received:66': 0.35; 'received:10': 0.37; 'handle': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'header:Message-Id:1': 0.63
DKIM-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:from:to:mime-version :content-transfer-encoding:content-type:in-reply-to:references :subject:date; s=smtpout; bh=03vSOcueVD/Si/cWaWsd+MpIkMs=; b=q60 qTbfnd4oq/3ND2/lIm6DAK+thawSmINgUuo67IMmNLdY/lRYzx3cMC0+AYmIk9jc +eie/RNgSCUqJ8OD2aci5kU8u2sPf5m1IveT38Whe9GeKmr2mNY01Bi3h7gpbU57 Hrqh+oWZId3u3mECPSW4eGho1c15c+WQ6oOSv07g=
X-Sasl-Enc tulCO66m14g2l4GN6zNr6d0IZ8zBKasd/OWi2eU4gHJu 1374076300
From "Clark C. Evans" <cce@clarkevans.com>
To python-list@python.org
MIME-Version 1.0
Content-Transfer-Encoding 7bit
Content-Type multipart/alternative; boundary="_----------=_1374076300203003"; charset="utf-8"
X-Mailer MessagingEngine.com Webmail Interface - ajax-5a449c7a
In-Reply-To <CACGSewf0J3SPNssM-iJPg1Rthj+_wJe1p-fGe4_FcgxHGiJu0A@mail.gmail.com>
References <CACGSewf0J3SPNssM-iJPg1Rthj+_wJe1p-fGe4_FcgxHGiJu0A@mail.gmail.com>
Subject Re: [ANN]:JSONStream
Date Wed, 17 Jul 2013 11:51:40 -0400
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.4804.1374076304.3114.python-list@python.org> (permalink)
Lines 68
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1374076304 news.xs4all.nl 15984 [2001:888:2000:d::a6]:53944
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:50795

Show key headers only | View raw


[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'}

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web