Hacker News new | ask | show | jobs
by cgidriver 2363 days ago
is there something like this for gmail? Where I could query emails from Python and act on them?
3 comments

GMail has an IMAP-interface. You can use any imap-capable solution, including pythons own imaplib.
IMAP cannot operate on a whole thread at a time. Ironically you will hardly notice the difference when operating with the web interface, which is very much thread based, but it can be useful to apply a label to a whole thread if your interaction with GMail happens in Thunderbird or mutt. For example, I have a Google Apps script that adds a label to a whole thread whenever someone CCs me on a bug, so that the entire bug suddenly pops up in the "my bugs" Thunderbird folder, including messages prior to my being added.
Yes and no. You must fetch the whole thread in a seperate request and handle them specifically. Bit more work, but simple.

https://developers.google.com/gmail/imap/imap-extensions#acc...

There's a restful Gmail API, and Python bindings.

https://developers.google.com/gmail/api/downloads