Python 的 Email 解析库:Flanker

jopen 10年前

Flanker 是一个用来解析电子邮件和 MIME 的 Python 库。

示例代码:

>>> from flanker.addresslib import address  >>>  >>> address.parse('Foo foo@example.com')  Foo <foo@example.com>    >>> from flanker import mime  >>>  >>> msg = mime.from_string(message_string)  >>> msg.headers.items()  [('Mime-Version', '1.0'),   ('Content-Type',    ('multipart/alternative', {'boundary': u'001a11c1d71697c7f004e6856996'})),   ('From', 'Bob <bob@example.com>'),   ('To', 'Alice <alice@example.com>'),   ('Subject', 'hello, world'),   ('Date', 'Mon, 16 Sep 2013 12:43:03 -0700')]

项目主页:http://www.open-open.com/lib/view/home/1384484236539