1 Return-Path: <ciprian.craciun@gmail.com>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id B2A4D429E25
\r
6 for <notmuch@notmuchmail.org>; Sat, 10 Dec 2011 17:03:58 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id IGPwMGEZdg-i for <notmuch@notmuchmail.org>;
\r
17 Sat, 10 Dec 2011 17:03:58 -0800 (PST)
\r
18 Received: from mail-iy0-f181.google.com (mail-iy0-f181.google.com
\r
19 [209.85.210.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 33C68431FB6
\r
22 for <notmuch@notmuchmail.org>; Sat, 10 Dec 2011 17:03:58 -0800 (PST)
\r
23 Received: by iaoo28 with SMTP id o28so6449952iao.26
\r
24 for <notmuch@notmuchmail.org>; Sat, 10 Dec 2011 17:03:57 -0800 (PST)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
\r
26 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
\r
27 :cc:content-type:content-transfer-encoding;
\r
28 bh=tLY/qNwBXmmsh05b9U4kAIMS4kez5+BJA70qGDyQd5k=;
\r
29 b=T2xH05wnc09z8tjNSSTbl7UZHX+68nuCL2YEpMNfZMiAtjQHP5K9O5wjzeDMUGOkJK
\r
30 51i6ml09dLLqorna+R80HUV8hXg5Qbxl1KE9XDXoLiryPiAA4yVvpA/Eky3Qb7LV/7CX
\r
31 qajUrNLnSUJQDE/3o4X+/DU5Inot5Ig3kkOd4=
\r
33 Received: by 10.182.54.80 with SMTP id h16mr1715660obp.59.1323565437768; Sat,
\r
34 10 Dec 2011 17:03:57 -0800 (PST)
\r
35 Received: by 10.182.222.35 with HTTP; Sat, 10 Dec 2011 17:03:57 -0800 (PST)
\r
36 In-Reply-To: <878vmk581q.fsf@servo.finestructure.net>
\r
38 <CA+Tk8fycS4kmBRABRS4vFQLb3v0-ajcLZwPOwwEf98yvObgpwA@mail.gmail.com>
\r
39 <87zkf05gk4.fsf@servo.finestructure.net>
\r
40 <CA+Tk8fw+ky6hS0JGLQ4THOf+PSEZhSpfXRF=haayfAdF8HB6PQ@mail.gmail.com>
\r
41 <878vmk581q.fsf@servo.finestructure.net>
\r
42 Date: Sun, 11 Dec 2011 03:03:57 +0200
\r
44 <CA+Tk8fy0xnRuPjuPc9Sz=om9AS9Gwa8fBe+VQjoetO-nJ+kqYg@mail.gmail.com>
\r
45 Subject: Re: Exporting a single email as JSON
\r
46 From: Ciprian Dorin Craciun <ciprian.craciun@gmail.com>
\r
47 To: Jameson Graef Rollins <jrollins@finestructure.net>
\r
48 Content-Type: text/plain; charset=UTF-8
\r
49 Content-Transfer-Encoding: quoted-printable
\r
50 Cc: notmuch@notmuchmail.org
\r
51 X-BeenThere: notmuch@notmuchmail.org
\r
52 X-Mailman-Version: 2.1.13
\r
54 List-Id: "Use and development of the notmuch mail system."
\r
55 <notmuch.notmuchmail.org>
\r
56 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
57 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
58 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
59 List-Post: <mailto:notmuch@notmuchmail.org>
\r
60 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
61 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
62 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
63 X-List-Received-Date: Sun, 11 Dec 2011 01:03:58 -0000
\r
65 On Sun, Dec 11, 2011 at 01:19, Jameson Graef Rollins
\r
66 <jrollins@finestructure.net> wrote:
\r
67 > On Sun, 11 Dec 2011 00:46:51 +0200, Ciprian Dorin Craciun <ciprian.craciu=
\r
69 >> =C2=A0 =C2=A0 * in my use-case I would need each line of the output to b=
\r
71 >> standalone JSON object of an individual message; (thus I can script
\r
72 >> with Bash `notmuch ... | while read message ; do ... ; done`;)
\r
74 > This is actually a slightly different idea than what I thought you were
\r
75 > originally proposing. =C2=A0Outputting a series of json objects rather th=
\r
77 > single list has been talked about for notmuch search as well. =C2=A0I'm d=
\r
79 > have a good sense of whether this is a sensible idea or not.
\r
81 >> =C2=A0 =C2=A0 * maybe someone else would need that the output to contain
\r
82 >> **exactly one** such message (maybe the first);
\r
84 > This is what I thought we were talking about. =C2=A0This is an option I w=
\r
86 > like to see, at least.
\r
89 Indeed exporting multiple messages as top / root JSON objects
\r
90 isn't quite usable except limited import / export use-cases, thus what
\r
91 you propose is more sensible. And in the end by having this
\r
92 possibility I could easily implement the solution I'm seeking as
\r
95 notmuch --output=3Dmessages -- {criteria} \
\r
96 | xargs -L 1 -- notmuch show --format=3Djson -- \
\r
97 | while read message_json ; do ... ; done
\r
100 But there is only one problem with such an approach: efficiency.
\r
101 With the snippet above I'll have as many `notmuch` process executions
\r
102 as messages. (And I do have quite a few of them.) Thus although
\r
103 Notmuch is quite fast -- as in human imperceptible -- still opening
\r
104 and closing the Xapian database so many times does have quite an
\r
107 So in the end I think a discussion about the needed (/ wanted)
\r
108 use-cases would be better.
\r
112 P.S.: I could help implement (or at least prototype) some of these
\r
113 use-cases. Thus I'll watch over the thread you've pointed me to.
\r