Exporting a single email as JSON

Jameson Graef Rollins jrollins at finestructure.net
Sat Dec 10 15:19:29 PST 2011


On Sun, 11 Dec 2011 00:46:51 +0200, Ciprian Dorin Craciun <ciprian.craciun at gmail.com> wrote:
>     I've given a quick look into `notmuch-show.c` (commit from
> December 4) and indeed it seems quite trivial to add new formats.
> 
>     Thus I wonder:
>     a) Is the code suitable for experimenting such a feature? (I mean
> is the "overhaul" almost done, or still in progress?)

I think it's more just beginning rather than hearing completion.  You
can follow what's happened so far in the thread starting here:

id:"1322446871-14986-1-git-send-email-amdragon at mit.edu"

>     c) Would someone else be interested in such a feature? (Or it's
> something so remote that only the two of us stumbled upon it?)

I think it would be a useful feature, and if it's useful for you it's
probably worth implementing.

>     * in my use-case I would need each line of the output to be a
> standalone JSON object of an individual message; (thus I can script
> with Bash `notmuch ... | while read message ; do ... ; done`;)

This is actually a slightly different idea than what I thought you were
originally proposing.  Outputting a series of json objects rather than a
single list has been talked about for notmuch search as well.  I'm don't
have a good sense of whether this is a sensible idea or not.

>     * maybe someone else would need that the output to contain
> **exactly one** such message (maybe the first);

This is what I thought we were talking about.  This is an option I would
like to see, at least.

>     * or maybe the separator in the first use case should be `\0`
> instead of `\n`;

I think specifying the separator should just be an option.

jamie.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20111210/4f968d6e/attachment.pgp>


More information about the notmuch mailing list