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

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).