-
-
Save pacuna/4a726e9183ee2618f5a17f6c07377af8 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", "wb")) | |
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