132 Part II — Getting Inside Gmail
FIGURE 7-3: Python’s Libgmail binding
You should follow the instructions on their website to install the latest version. As
mentioned before, if Libgmail stops working, it may just be a matter of time
before a new version restores functionality.
How to Use It
Libgmail comes with some sample code, but no real documentation at the
moment. There are currently 15 methods available, which offer the vast majority
of the functionality that Gmail can give. Start by logging in.
login
To log in, import the Libgmail bindings, create a new GmailAccount object, and
use the login method on it, like so:
import Libgmail
ga = Libgmail.GmailAccount(“google@gmail.com”,
“mymailismypass”)
ga.login()
Now that you’re logged in, you want to retrieve the messages from a folder.
FIGURE 7-3: Python’s Libgmail binding
You should follow the instructions on their website to install the latest version. As
mentioned before, if Libgmail stops working, it may just be a matter of time
before a new version restores functionality.
How to Use It
Libgmail comes with some sample code, but no real documentation at the
moment. There are currently 15 methods available, which offer the vast majority
of the functionality that Gmail can give. Start by logging in.
login
To log in, import the Libgmail bindings, create a new GmailAccount object, and
use the login method on it, like so:
import Libgmail
ga = Libgmail.GmailAccount(“google@gmail.com”,
“mymailismypass”)
ga.login()
Now that you’re logged in, you want to retrieve the messages from a folder.
