Cataclysmic Mutation

Machine Learning and Whatever Else

Syncing Google Contacts to BBDB -- Introducing Charrington

I use Emacs as my usual mail client, currently with notmuch, but occasionally with Gnus as well. One of the really nice features to get working with any Emacs mail client is BBDB integration. BBDB, the “ubiquitous Big Brother DataBase”, is an address book for Emacs. It can do quite a few things, but I mostly only use it to autocomplete addresses when I’m sending mail.

Both my personal and work accounts are now hosted through Google Apps, and especially with an Android phone, Google Contacts is by far the most sensible place for my contacts to call their canonical home base. However, this introduces a problem – Emacs doesn’t want to play nicely with Google. There are tools, most notably the “Little Brother DataBase” (LBDB), which has connections to all sorts of data providers. However, (a) I never managed to get the UI for LBDB to be as nice and seamless as BBDB is, and (b) having to query a remote server to tab-complete an address introduces a really annoying delay.

There are a few tools out there that claim to write BBDB records from Google’s data, but I had very poor luck with them. They were fairly hard to get running, and typically left me with files that BBDB would choke on, perhaps due to character set issues (I have numerous Icelandic and other international colleagues with “interesting” characters in their names and addresses). Most of them seem to be quite old and unmaintained as well.

With that in mind, I wrote “Charrington”. The name is perhaps a little bit indulgent – Charrington was the member of the thought police in Orwell’s “1984” who turned Winston and Julia in to Big Brother. He kept Big Brother in the loop…get it? Huh? Like I said, it’s a stretch.

In any case, you can grab the code from Github and give it a spin. I’m sure there are plenty of bugs aside from the ones I already know about, so if you run into any problems, let me know.