◈ Mail → Excel

Excel export for Data analysts

By the Mail → Excel team · Updated 2026-10-20

Email metadata is an underused dataset: response times, senders, topics. A clean export is the first step. This page lists the exact columns, an example row and the command that produces it.

Columns to keep

ColumnWhy it matters
dateMessage date in ISO 8601; sortable and unambiguous across time zones.
senderWho wrote in; used for triage and routing.
subjectMessage subject, MIME-decoded.
threadThread id; the only reliable dedupe key for conversations.
attachmentsNumber of attachments; a cheap filter for «has documents».

Example row

One real-shaped row from this role’s export:

datesendersubjectthreadattachments
2026-10-14ops@data.ioWeekly export232

Export it in one command

python mail_to_excel.py \
  --host imap.example.com --user you@example.com \
  --days 31 --fields date,sender,subject,thread,attachments \
  --out data-analyst.xlsx

The --fields option is what turns a raw dump into a report your role can use.

Provider notes

Gmail shows label copies; export one label to avoid counting the same message twice.

Two pitfalls that ruin the file

Next step

Step-by-step: export data analyst email to Excel · all roles · ready script ($3)

FAQ

What format should I use?

CSV with ISO dates and lowercase emails; Excel is for reading, CSV for pipelines.

Can I get message bodies?

Yes, but bodies are heavy and noisy; start with metadata and add bodies only for the analysis you need.

Is there a ready script for this?

Yes — the Python script exports any IMAP mailbox with the fields listed above; it costs $3 and runs locally.

Related guides