Scripting Google Voice in Python

Published:

In the interest of getting some of the fragments of code I've written off my hard disk and out where someone might find them useful I've decided to start dumping them into git repos with some very minimal documentation. Minimal enough that I actually kick them out there.

The first is a simple Python library to access Google Voice's calling and texting functionality:

% python                  
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from googlevoice import *
>>> gv = GoogleVoice('googleaccount', 'googlepassword')
>>> gv.sms('+1415MYNUMBER', 'this is a test')
>>> gv.call('+1415MYNUMBER', '18003569377')
The library depends on BeautifulSoup. It's based on a bunch of work that I found on the internet. I don't remember exactly whose techniques I ended up using, but there's a bunch of example code out there, just not much that was simple to use and in Python.