Skip to main content

csv-from-mbox

Turn an .mbox export into a CSV you can actually open in a spreadsheet.

You know the drill: Google Takeout hands you a two-gigabyte All mail Including Spam and Trash.mbox, and every tool that can open it wants to be an email client about it. This one does not. One Python file, standard library only, two modes, done.

What it does

Messages mode (default): one row per email.

date from_name from_email to cc subject body
2026-08-28T10:00:00+01:00 Ash Ketchum ash@pallet.town misty@cerulean.gym Gym battle I choose you!

Bodies prefer text/plain, HTML-only emails get their tags stripped, attachments are ignored, encoded headers (=?utf-8?q?Pok=C3=A9mon?=) are decoded, and dates come out ISO 8601 so your spreadsheet sorts them properly.

Addresses mode (--addresses): the original party trick. Every unique sender address, lowercased, deduplicated and sorted, with automated senders (noreply, no-reply, do-not-reply, do_not_reply, donotreply) filtered out. Great for finding out who actually writes to you.

Install

Run it straight from GitHub with uv or pipx:

uvx --from git+https://github.com/vsevolod-mineev/csv-from-mbox csv-from-mbox mail.mbox
pipx run --spec git+https://github.com/vsevolod-mineev/csv-from-mbox csv-from-mbox mail.mbox

Or clone it and run the file, there are no dependencies to install:

python3 csv_from_mbox.py mail.mbox

pip install csv-from-mbox also exists, but PyPI currently carries the 2021-era 0.4.5; use the GitHub version until 0.5.0 lands there.

Use

csv-from-mbox mail.mbox                # messages.csv with everything
csv-from-mbox mail.mbox --no-body      # metadata only, much smaller file
csv-from-mbox mail.mbox --addresses    # emails.csv with unique senders
csv-from-mbox mail.mbox -o ~/Desktop   # choose where it goes
csv-from-mbox                          # no arguments? it will ask nicely

Test

python3 -m unittest discover tests

Requirements

Python 3.9 or newer. Nothing else. That is the whole point.

License

MIT.

Release files for csv-from-mbox 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for csv-from-mbox 0.5.0
File Size Uploaded
csv_from_mbox-0.5.0.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for csv-from-mbox 0.5.0
File Interpreter ABI Platform
csv_from_mbox-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.3 kB

Release files / csv_from_mbox-0.5.0.tar.gz

Download URL csv_from_mbox-0.5.0.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
97c604f498e76a41e53ff7ee31eecd66442344975b0c124162a743309e0b57e3
BLAKE2b-256 checksum
How to use checksums
408aef347a5657127e093785c0df1e3a3e8437838c0378d7076f4f133561b176
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / csv_from_mbox-0.5.0-py3-none-any.whl

Download URL csv_from_mbox-0.5.0-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c5c4a32e05d209c8947c830f1be97084ca4f6dc44fd7c76c88717c00af328fb4
BLAKE2b-256 checksum
How to use checksums
8bc5dd24f8d1147af5393b98f9eb308e76663d84306bcf13e099fb69513e4261
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.5.1

2 release files

This release

0.5.0 This release

2 release files

0.4.5

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page