简体   繁体   English

python:用于解析电子邮件的库

[英]python: libraries for parsing email

Are there libraries for email message parsing (particularly, from Gmail's IMAP server) in Python (except for the standard email library)? 是否有Python格式的库(尤其是从Gmail的IMAP服务器中)用于电子邮件解析(标准电子邮件库除外)?

Or if not, maybe there is some C++ library for this purpose (and I'll be able to use it through SWIG)? 或者,如果没有,也许有一些用于此目的的C ++库(我将能够通过SWIG使用它)?

This question does not make sense. 这个问题没有道理。 You can access GMail either using IMAP or POP3. 您可以使用IMAP或POP3访问GMail。 And for parsing retrieved emails you use the 'email' module of Python. 对于解析检索到的电子邮件,您可以使用Python的“电子邮件”模块。 Python provides support for all this out-of-the-box "all batteries included". Python为所有这些开箱即用的“包括所有电池”提供了支持。

http://libgmail.sourceforge.net/ is a Python bindings to Gmail. http://libgmail.sourceforge.net/是与Gmail的Python绑定。 Also you have Gdata apis in Python http://pypi.python.org/pypi/gdata/2.0.4 which can help interact with Gmail. 另外,您还可以使用Python http://pypi.python.org/pypi/gdata/2.0.4中的 Gdata api来帮助与Gmail进行交互。

For other stuffs, the standard library module email is good pretty good. 对于其他内容,标准库模块电子邮件非常不错。 And Email messages are formatted according to RFC2822, a standard library module named rfc822 and mimetools may help you to deal with the contents of the email. 电子邮件是根据RFC2822格式化的,RFC2822是名为rfc822mimetools的标准库模块,可以帮助您处理电子邮件的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM