Tags: email

Gmail statistics

On which days of the week do you send or receive emails? What time of the day? Well, let’s find out.

I have been somewhat inspired by Stephen Wolfram and used some of the fabulous open-source libraries that are available for data exploration: I have been playing around with imaplib, pandas, seaborn/matplotlib and came up with a script to analyze your email behavior. You can use it with any IMAP account (yes, that includes your Gmail account). Of course, only the emails that are not yet deleted are analyzed – but usually Gmail users archive most of the emails – they are then accessible in the “All Mail” folder. The typical output gives you bar plots as well as violin plots, such as here:

bar plots and violin plots for the sent and received emails.

Interestingly, the analysis here shows that a significant amount of emails is sent after the “classical” work hours (particularly after midnight). As expected, almost no emails are sent during the sleep time (between ~2am and ~8am). Also, the weekend is rather quiet, albeit with Monday approaching increased activity is observed.

The script is released under GPL and can be found at: https://github.com/alexriss/email-stats

Migrating Gmail

I wanted to migrate all my emails from one gmail account to another. Unfortunately, Google does not seem to offer an easy automated method. When I tried importing the mails from the other account via POP, my label system was not reproduced (I am an avid labeler). People suggest to use IMAP (where labels are represented as IMAP folders). You can use an email client (such as Mozilla Thunderbird) to download all emails form one account. And then copy all the emails to the other account. While downloading worked well for me, uploading of the emails to the other account always ended up in connection errors.

Eventually I found a tool called larch, which automates the process. It is a ruby program (which can be very easily installed on Windows, Linux, or MacOS) and it deals with all the problems of the IMAP migration for you. I can’t say that it is fast, but at least it seems robust. Simple command line interface. Highly recommended.