Flanker是一个用来解析电子邮件和MIME的Python库。
示例代码:
>>>fromflanker.addresslibimportaddress>>>>>>address.parse('Foofoo@example.com')Foo<foo@example.com>>>>fromflankerimportmime>>>>>>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,16Sep201312:43:03-0700')]
评论