unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* mu-guile: e-mail searching and stats
@ 2012-02-01 15:03 Dirk-Jan C. Binnema
  2012-02-02 22:31 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Dirk-Jan C. Binnema @ 2012-02-01 15:03 UTC (permalink / raw)
  To: guile-user

Hi Guilers,

I've just released version 0.9.8 of mu[1], my e-mail search engine / indexer
(and now also an experimental e-mail client[2] for emacs).

For Guile-users, however, the most interesting part are guile-bindings[3] that
I have added. With those bindings, you can analyze your e-mail corpus, and
generate all kinds of interesting statistics. While I'm no Guile/Scheme expert
by any means, I'm quite happy with the result, and the power it adds to my
program to add being able to script in Guile; note, only Guile 2.0 is
supported.

There's a manual[4], which has a lot of examples on how to create little
scripts and generate statistics. As a very simple example, suppose I want to
see the frequency of messages containing the word "hello" in the subject-line
per weekday:

--8<---------------cut here---------------start------------->8---
(use-modules (mu) (mu message) (mu stats))

;; get a list of ("Weekday" . <frequency>) pairs
(define (weekday-table expr)
  (mu:weekday-numbers->names 
    (sort
      (mu:tabulate-messages
        (lambda (msg)
          (tm:wday (localtime (mu:date msg)))) expr)
      (lambda (a b) (< (car a) (car b))))))  

(mu:initialize)
      
(for-each
  (lambda (elm)
    (format #t "~a: ~a\n" (car elm) (cdr elm)))
    (weekday-table "subject:hello"))
--8<---------------cut here---------------end--------------->8---

and get output like:

Sun: 23
Mon: 19
Tue: 28
Wed: 20
Thu: 27
Fri: 16
Sat: 25

You can also draw graphs of this -- see [3], and there are some examples (in
the examples/ dir), which let you actually do lots of graphs/stats *without*
any coding. But that's not so much heh?!

I'd be happy to hear any feedback or suggestions; I'm eager to learn. I have
some ideas for a next version, including making a simple guile-based procmail
replacement, and hooking things up with mu4e, but let's see what happens...

Happy hacking & thanks to the nice people in #guile for helping me with my
questions.

--Dirk.


[1] http://www.djcbsoftware.nl/code/mu
[2] http://www.djcbsoftware.nl/code/mu/mu4e.html
[3] http://www.djcbsoftware.nl/code/mu/mu-guile.html
[4] http://www.djcbsoftware.nl/code/mu/mu-guile/index.html


-- 
Dirk-Jan C. Binnema                  Helsinki, Finland
e:djcb@djcbsoftware.nl           w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: mu-guile: e-mail searching and stats
  2012-02-01 15:03 mu-guile: e-mail searching and stats Dirk-Jan C. Binnema
@ 2012-02-02 22:31 ` Ludovic Courtès
  2012-02-04 14:57   ` Dirk-Jan C. Binnema
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2012-02-02 22:31 UTC (permalink / raw)
  To: guile-user

Hello,

Dirk-Jan C. Binnema <djcb.bulk@gmail.com> skribis:

> I've just released version 0.9.8 of mu[1], my e-mail search engine / indexer
> (and now also an experimental e-mail client[2] for emacs).
>
> For Guile-users, however, the most interesting part are guile-bindings[3] that
> I have added. With those bindings, you can analyze your e-mail corpus, and
> generate all kinds of interesting statistics. While I'm no Guile/Scheme expert
> by any means, I'm quite happy with the result, and the power it adds to my
> program to add being able to script in Guile; note, only Guile 2.0 is
> supported.

This all looks like an interesting piece of work!

Incidentally, GNU Mailutils supports many common email-related
operations and comes with Guile bindings [0], but lacks the database
part that mu provides.  I wonder whether/how the two could be plugged
together.

Thanks,
Ludo’.

[0] http://gnu.org/s/mailutils/




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Re: mu-guile: e-mail searching and stats
  2012-02-02 22:31 ` Ludovic Courtès
@ 2012-02-04 14:57   ` Dirk-Jan C. Binnema
  2012-02-05  6:24     ` Antono Vasiljev
  0 siblings, 1 reply; 4+ messages in thread
From: Dirk-Jan C. Binnema @ 2012-02-04 14:57 UTC (permalink / raw)
  To: guile-user, Ludovic Courtès

Hi,

On 2012-02-03T00:31:06 EET, Ludovic Courtès wrote:

 > Hello,
 >
 > Dirk-Jan C. Binnema <djcb.bulk@gmail.com> skribis:
 >
 > > I've just released version 0.9.8 of mu[1], my e-mail search engine / indexer
 > > (and now also an experimental e-mail client[2] for emacs).
 > >
 > > For Guile-users, however, the most interesting part are guile-bindings[3] that
 > > I have added. With those bindings, you can analyze your e-mail corpus, and
 > > generate all kinds of interesting statistics. While I'm no Guile/Scheme expert
 > > by any means, I'm quite happy with the result, and the power it adds to my
 > > program to add being able to script in Guile; note, only Guile 2.0 is
 > > supported.
 >
 > This all looks like an interesting piece of work!

Thanks!

 > Incidentally, GNU Mailutils supports many common email-related
 > operations and comes with Guile bindings [0], but lacks the database
 > part that mu provides.  I wonder whether/how the two could be plugged
 > together.

Yeah, I took a look at GNU Mailutils a while back (mainly to see how express
certain things in the bindings). Confusingly, in Debian/Ubuntu, mu has a
package called "maildir-utils" (I guess "mu" is too short..), so there are two
packages "mailutils" and "maildir-utils"...

I do not really see an easy way to combine GNU Mailutils and mu; but it would
be interesting to hear what cool things people have written using the former,
and see if I could support the same with mu's bindings.

Best wishes,
Dirk.

--
Dirk-Jan C. Binnema                  Helsinki, Finland
e:djcb@djcbsoftware.nl           w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Re: Re: mu-guile: e-mail searching and stats
  2012-02-04 14:57   ` Dirk-Jan C. Binnema
@ 2012-02-05  6:24     ` Antono Vasiljev
  0 siblings, 0 replies; 4+ messages in thread
From: Antono Vasiljev @ 2012-02-05  6:24 UTC (permalink / raw)
  To: djcb; +Cc: guile-user, Ludovic Courtès



On Sat 04 Feb 2012 05:57:58 PM FET, Dirk-Jan C. Binnema wrote:

Mu and Mu4e rocks! First mail client for emacs that just works as expected!

 >  > Incidentally, GNU Mailutils supports many common email-related
 >  > operations and comes with Guile bindings [0], but lacks the database
 >  > part that mu provides.  I wonder whether/how the two could be plugged
 >  > together.
 > 
 > Yeah, I took a look at GNU Mailutils a while back (mainly to see how express
 > certain things in the bindings). Confusingly, in Debian/Ubuntu, mu has a
 > package called "maildir-utils" (I guess "mu" is too short..), so there are two
 > packages "mailutils" and "maildir-utils"...

 Even worse. Both mailutils and maildir utils provide 'mu' command.
 
 > I do not really see an easy way to combine GNU Mailutils and mu; but it would
 > be interesting to hear what cool things people have written using the former,
 > and see if I could support the same with mu's bindings.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-02-05  6:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-01 15:03 mu-guile: e-mail searching and stats Dirk-Jan C. Binnema
2012-02-02 22:31 ` Ludovic Courtès
2012-02-04 14:57   ` Dirk-Jan C. Binnema
2012-02-05  6:24     ` Antono Vasiljev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).