Automatically reads .eml files from a folder, analyzes each email using a local Qwen3 model, and exports a clean summary to Excel.
100% offline — no data leaves your machine.
- Parses
.emlfiles (sender, subject, date, body) - Uses a local Qwen3 model via LM Studio to extract keywords and write a short summary
- Exports everything to a formatted
.xlsxfile
| Column | Description |
|---|---|
| Mailbox | Email address of the sender |
| Subject | Email subject |
| Date | Date sent |
| Keywords | Important keywords extracted by AI |
| Summary | Short 1–2 sentence summary of the email |
- macOS (tested on MacBook Air M2)
- Python 3.10+
- LM Studio installed with a Qwen3 model downloaded
- Download LM Studio
- Open LM Studio → Search for
Qwen3-8B(recommended for M2) - Download the Q4_K_M variant (good balance of speed vs quality on M2)
- Load the model → go to Local Server tab → click Start Server
LM Studio will serve the model at
http://localhost:1234
Open src/ai_analyzer.py and update this line to match the model name shown in LM Studio:
MODEL_NAME = "qwen3-8b" # ← change this to match your LM Studio model namecd email-recap
python -m venv venv
source venv/bin/activate
pip install -r requirements.txtdata/
└── emails/
├── invoice_june.eml
├── meeting_notes.eml
└── ...
LM Studio → Local Server tab → Start Server (green button)
python src/main.pyoutputs/email_recap.xlsx
email-recap/
├── README.md # This file
├── .gitignore
├── requirements.txt # openai, openpyxl
├── src/
│ ├── main.py # Entry point — runs the full pipeline
│ ├── eml_reader.py # Parses .eml files into structured data
│ ├── ai_analyzer.py # Calls local Qwen model for keywords + summary
│ └── excel_writer.py # Writes results to formatted .xlsx
└── data/
└── emails/ # Drop your .eml files here
| Mailbox | Subject | Date | Keywords | Summary |
|---|---|---|---|---|
| vendor@supplier.com | Invoice #1042 | 2024-06-01 | invoice, payment, due date | Vendor sent invoice #1042 for $2,400 due by June 15. |
| hr@company.com | Annual Leave Policy | 2024-06-03 | leave, policy, HR, approval | HR updated the annual leave policy, requiring 2-week prior approval. |
- Recommended model for M2: qwen3.5-9b* (~5GB RAM, fast enough for batch processing)
- Email body is trimmed to 3000 characters before sending to the model (saves processing time)
- Qwen3's "thinking mode" output (
<think>...</think>) is automatically stripped - No API key, no internet connection needed