How to analyze email with python?

12 views
Skip to first unread message

Vonpupp

unread,
Jun 24, 2022, 9:50:58 AM6/24/22
to mu-discuss
Hello,

I would like to analyze my emails with python and answer some question like who are the most frequent senders, how many emails I receive per day, etc.

I am pretty sure this is doable by parsing all the mail folders directly. But I thought using mu's xapian db instead would make more sense.

Any idea if using mu's xapian db would possible for these purposes and how to start? My idea would be generate a huge dataframe in pandas for later analysis.

Thanks.
Albert.

Husain Alshehhi

unread,
Jun 25, 2022, 11:50:38 PM6/25/22
to mu-di...@googlegroups.com, Vonpupp
Does `mu find` not satisfy your need? see `man mu-find`.

--
Husain

Dirk-Jan C. Binnema

unread,
Jun 26, 2022, 2:41:44 AM6/26/22
to mu-di...@googlegroups.com
In particular, starting with e.g.
mu find "" --format=json
gets you all messages in json-format which you can then process in
python.

Note that dates are represented in the funny emacs time representation.

Kind regards,
Dirk.

--
Dirk-Jan C. Binnema Helsinki, Finland
e:dj...@djcbsoftware.nl w:www.djcbsoftware.nl
gpg: 6987 9CED 1745 9375 0F14 DA98 11DD FEA9 DCC4 A036

Vonpupp

unread,
Jun 26, 2022, 11:45:49 PM6/26/22
to mu-discuss
Thank you very much both. I am very grateful for pointing me into the right direction. That is a solid start.

Regards,
Albert.
Reply all
Reply to author
Forward
0 new messages