Python 的 Email 解析庫:Flanker
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')]
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!