At one point it was possible to use scripts like libgmail and gmail.py (can\'t post more than one hyperlink) to export mail from Gmail accounts. Both of those seem to not w
Gmail supports IMAP and POP, which are common protocols for accessing email. You should be able to use use any working IMAP or POP library for Python to download your email. If you want tag/folder information, you'll need to stick to IMAP.