Skip to content
TriedPrompts

More in Caregiving & Loss. Also fits: Email, Calendar & Organizing.

Find a mother's friends in 25 years of email by having ChatGPT write Python scripts for invitations

ChatGPT wrote Python scripts that pulled about 160 real contacts from 25 years of email for a celebration of life.

Result: WorkedTool: ChatGPTLevel: AdvancedSetup: Needs Python

Copy the prompt

Outcome

After the death of a mother whose contacts were scattered across a phone, two email accounts and handwritten notes, Nick Hart wanted to invite everyone to a celebration of life. Hart exported the emails, which were gigabytes of MBOX files too big to upload to ChatGPT, and had ChatGPT write a Python script that pulled email addresses into a SQLite database with context such as sender or recipient, mailing-list signs and interaction counts. A second script filtered the results, matched them to an address-book export and filled in names. Hart refined the scripts with ChatGPT after finding anomalies such as addresses re-sent through a groups service. The result was a list of about 160 contacts who appeared to be real people the mother had corresponded with over 25 years, and Hart published the tool on GitHub.

What to copy

Copy this core ask: A reviewed list of the real people in a relative's email, ready for invitations or notices.

What to change for your situation

Replace these placeholders with your details: [MBOX FILES AND SIZES], [CSV]. Typical inputs to personalize: Email exports, Contacts export, Purpose, Environment.

Evidence: Described by posterThe person describes what happened in words, without screenshots or video.

WorkedEvidence: Described by posterPosted Last checked

Level: Advanced. You need: A tool that takes actions for you or writes code, connected accounts, or some setup on your computer.

How to use this

  1. Tap Copy prompt.
  2. Open ChatGPT.
  3. Paste it into the message box.
  4. Send it, then read the answer before acting on it.
New to this? What's a prompt?

A prompt is the message you send to the AI tool. Copy the one on this page, put your own details where it asks, and read the answer before you act on it.

Prompt

Recreated prompt

The source didn't share its exact prompt, so we wrote one from what it describes. The result shown is the source's, not ours.

What the prompt labels mean

The person didn't share their exact words, so we wrote this from what they described. We haven't tested it, and they didn't use this exact version.

I have a very large export of a relative's email in MBOX files and a contacts CSV. Write a Python script that extracts email addresses into a SQLite database, recording whether each was a sender or recipient, signs it came from a mailing list, and how many times it appears. Then write a second script that filters for likely real people, matches names from the contacts CSV, and outputs a CSV with name, email and count.

Try this in:

Sends the Recreated prompt shown above. ChatGPT and Grok open with it filled in, and ChatGPT may send it straight away. Gemini and Claude open empty, so we copy the prompt for you to paste. Every button also copies it.

Opens in a new tab. We don't see what you send.

These links are only a shortcut. We're not affiliated with OpenAI, Google, Anthropic or xAI, and your results may not match the source.

Optional stronger version

Our rewrite with extra checks. The poster didn't test it.

Before you start, ask me 1–3 short questions about the details below and wait for my answers. Once I've answered, confirm the plan in one line and run the whole task start to finish.

Goal: A reviewed list of the real people in a relative's email, ready for invitations or notices.

Questions to ask me first:
- What files do you have, and how large are they?
- What is the list for, and who should be included?
- Are you comfortable running Python scripts, and on which computer?

Inputs (fill in or confirm):
- Email exports: [MBOX FILES AND SIZES]
- Contacts export: [CSV]
- Purpose: [CELEBRATION OF LIFE, NOTICES]
- Environment: [OPERATING SYSTEM, PYTHON VERSION]

Rules:
- Process files locally and never upload private email anywhere.
- Record sender or recipient, mailing-list signs and counts for each address.
- Exclude newsletters and automated senders, and explain how.
- Output a CSV I can review by hand before contacting anyone.

Checkpoint: Show me the first 20 rows of output so I can spot patterns before the full run.

If you get stuck: If you see odd address patterns, tell me and suggest a fix.

Verify before you finish: Check the final count against a manual spot check of ten addresses.

Output: Two scripts, a short how-to-run guide and a reviewable CSV of likely real contacts.

Done when: I have a clean list of real contacts I can review and invite.

AI tool

ChatGPT

Source

Posted
by Nick Hart
Last checked
Method:
How we verify

https://nickhart.com/blog/5-ways-ai-helped-me-handle-my-mothers-passing/

Context: Personal blog post; date from the post. The post covers five uses of AI after the author's mother died; each is a separate task.

Tell us how it went A reader message. It is not published on this page, and it is not a test of the prompt.

More in Caregiving & Loss

More in PersonalRandom case in Personal