-
-
Save psteffek/2695458ae87a1dacb16104092687bf3b to your computer and use it in GitHub Desktop.
Simple mbox parser to csv in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mailbox | |
import csv | |
writer = csv.writer(open("mbox-output.csv", "w")) | |
for message in mailbox.mbox('file.mbox/mbox'): | |
writer.writerow([message['message-id'], message['subject'], message['from']]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
removing the "b" prevents it from opening as binary.