This repository now ships only the two flows that proved reliable:
- Convert WhatsApp exports into an email-like plain text (
parse_whatsapp.py) - Analyse those emails with GPT and produce highlighted HTML + CSV digests (
sophism_report.py) - BONUS :Payment monitoor and automatic reminders by email.
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtSet your OpenAI key once (either via .env or the shell):
echo "OPENAI_API_KEY=sk-..." > .env- Copy the example config and edit it:
cp config/autopn.example.yaml config/autopn.yaml
- For each relation define:
emails: the addresses that belong to thememail_archives.dir: where youremails_YYYY.txtfiles live (e.g.data/relations/example/emails)- optional
whatsapp.chat_export+whatsapp.email_output_dir reports.*paths for HTML + CSV outputs (defaults to subfolders insideemail_archives.dir)- any
context_historyyou want injected into the LLM prompt
The repo keeps data/ empty; drop your exports there locally.
python parse_whatsapp.py --relation exampleArguments:
--chat-fileto override the export path defined in the config--output-dirto store the generatedwhatsapp_<year>.txt
The script deduplicates messages per year and writes the AutoPN email format.
python sophism_report.py \
--relation example \
--years 2023-2024 \
--taxonomy-mode hintKey flags:
--year/--years all|2022-2024|2021,2024--normalizedto reademails_YYYY_NORMALIZED.txt--maxto cap the number of analysed messages (handy for dry-runs)--clear-light/--clear-eventsto reset CSV outputs--taxonomy-fileif you maintain your own sophism list
Outputs per relation:
- HTML reports under
reports.html_dir(default:<emails_dir>/sophismes) - A “rich” CSV (
reports.csv_events) with one line per detected event - A light CSV (
reports.csv_light) that you can open in Excel / Airtable
autopn/ Helper modules (config + event sink)
config/autopn.example.yaml Ready-to-copy template for your settings
data/ Empty placeholder; drop your private exports here
parse_whatsapp.py WhatsApp → AutoPN text converter
sophism_report.py GPT-powered analyser + HTML/CSV renderer
sophismes.yaml Default taxonomy
requirements.txt Minimal dependencies (openai, dotenv, PyYAML)
The project is published under the MIT License (see LICENSE). You are free to adapt it for private use; contributions that keep it privacy-friendly and easy to self-host are welcome.
AutoPN is a private aide-mémoire for emotionally charged or high-stakes conversations. By converting WhatsApp/email threads into a neutral timeline, then asking the LLM to flag sophisms, it becomes easier to:
- spot recurring tension triggers (e.g., guilt-tripping, topic switching, straw-man arguments)
- document what each party openly asked for versus what was implied or held back
- surface “hidden matters” (money, promises, authority) that often sit behind long fights
Typical use cases:
- Family disputes: inheritance, care duties, financial support, co-parenting logistics.
- Contracts & business deals: when one party rewrites history mid-negotiation.
- Workplace power plays: tyrannic managers, unpaid overtime, “friendly” requests that need a paper trail.
- Your own experiments: e.g., documenting harassment patterns in online communities or coaching someone on assertive replies.
Think of the reports as a friendly paralegal: it doesn’t replace a lawyer or therapist, but it gives you a structured view of who said what, why, and how credible it looked.
- Email passwords: never hard-code them. Use app-specific passwords when possible (Gmail, Outlook, Proton all support this). Store them in
.env(ignored by git) or export them in your shell session. Rotate them after each audit. - IMAP vs POP: IMAP keeps the mailbox in sync (including sent mail); POP usually downloads only inbox items and may delete copies server-side. If you need both incoming and sent conversations, IMAP access (or Gmail “All Mail”) is the safer choice. If you only have POP, export the “Sent” folder separately and drop it into the same
emails_YYYY.txtstructure. - OpenAI API keys / passkeys: treat them like credit cards. Create a dedicated key for AutoPN, restrict it to the
gpt-4o-minifamily, set a spending cap, and revoke it if the machine or repo ever feels compromised. The key lives in.env(OPENAI_API_KEY=…) or an environment variable; never commit it.
- Capture: export a chat/email thread (WhatsApp text file, Gmail takeout, Outlook PST converted to text) and drop it under
data/…. - Normalize: run
parse_whatsapp.py(for chats) or merge emails manually intoemails_YYYY.txtblocks. - Analyse: run
sophism_report.pyfor the year(s) that matter. - Review: open the HTML report in a browser, filter the CSV for hidden topics, and copy any excerpts you want to discuss with professionals (lawyer, mediator, coach).
- Decide: use the findings to write calmer replies, design boundaries, draft clauses, or simply archive a clean record for later.
AutoPN is best used when memory, stress, or deliberate gaslighting makes it hard to argue facts. The tool keeps you grounded in evidence and lets you focus on next steps instead of endless “he said / she said”.