title: What's the best way to use gmail programatically?
body: <p>I'm maintaining a project where we receive highly heterogenous data in a gmail inbox. Previously I was using a Ruby API for gmail, but it was highly unreliable and it didn't really fit in very well with all the other components of the system. For various reasons I won't go into here, this has to be the way it's done for at least some of our data (it's not my preference by any means!)</p>
  
  <p>So is there a good way to use Gmail in a nuanced way? Are there any languages with a good solid API that uses Gmail's native concepts? We need to execute some pretty complex behaviours while the email is still in the inbox based on combinations of tags that are set up by gmail filters.</p>
  
  <p>If all else fails I'm looking at building a wrapper for the IMAP library in Python; all the existing Python APIs that I could find have been broken by changes to the API-ish thing that gmail provides.</p>