Python library to parse and format email threads

emersion emersion Last update: Jun 09, 2022

emailthreads

builds.sr.ht status

Python library to parse and format email threads. Give it a list of emails thatare part of the same thread and it'll build a tree of responses to the originalmessage.

import emailthreadsimport mailboxmbox = mailbox.mbox("/path/to/mbox/thread")thread = emailthreads.parse(mbox)print(thread)

Tests

To run the tests, execute this command:

python3 -m pytest test

Given some raw messages, you can parse a thread from the CLI like so:

python3 -m emailthreads *.eml

License

MIT

Subscribe to our newsletter