4

Python has a email module in the standard library.

But this library is still very low-level.

For example getting the unicode string from a mail needs coding: https://stackoverflow.com/q/4157899/633961

I think this should be one method call. Not more.

Is there a high level library for parsing email in Python?

1

A quick google search returned the mail-parser library which looks nice and succinct.

https://pypi.org/project/mail-parser/

From the docs:

mail-parser takes as input a raw email and generates a parsed object.
The properties of this object are the same name of RFC headers:
 bcc
 cc
 date
 delivered_to
 from_ (not from because is a keyword of Python)
 message_id
 received
 reply_to
 subject
 to

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.