3 ms·
is there something like this for gmail? Where I could query emails from Python and act on them?
by cgidriver 7y ago
is there something like this for gmail? Where I could query emails from Python and act on them?
- slightwinder 7y agoGMail has an IMAP-interface. You can use any imap-capable solution, including pythons own imaplib.
- bonzini 7y agoIMAP 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.
- slightwinder 7y agoYes 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#access_to_the_gmail_thread_id_x-gm-thrid https://developers.google.com/gmail/imap/imap-extensions#acc...
- xtreak29 7y agoThis might help : https://automatetheboringstuff.com/2e/chapter18/ https://automatetheboringstuff.com/2e/chapter18/
- tyingq 7y agoThere's a restful Gmail API, and Python bindings. https://developers.google.com/gmail/api/downloads https://developers.google.com/gmail/api/downloads