A simple personal newsletter processing system that automatically fetches, processes, and generates AI-powered digest summaries from your email subscriptions. Detailed writeup here.
graph TD; A[⏰ Daily Scheduler] -->|8 PM Daily| B[Email Daily Processor] C[⏰ Weekly Scheduler] -->|Sunday 7 AM| D[Weekly Digest Generator] B -->|IMAP Fetch| E[📧 Email Servers] B -->|Primitive Filter| F[Potential Newsletters] F -->|Batch Processor| G[LLM Batch Analysis] G -->|10 newsletters/call| H[Summary] H --> I[📊 SQLite Database] D -->|Query Last 7 Days| I D --> L[📄 Weekly Digest] L --> M[Notion] N[👤 User] --> M style A fill:#fff3e0 style C fill:#e8f5e8 style B fill:#e1f5fe style D fill:#e8f5e8 style I fill:#f3e5f5 style G fill:#fff8e1 style M fill:#fce4ec
pip install -r requirements.txt
.env
file):# Gmail EMAIL_ADDRESS=your-email@gmail.com EMAIL_PASSWORD=your-app-password # OpenRouter (Free Gemini) OPENROUTER_API_KEY=your-openrouter-key # Notion NOTION_TOKEN=your-notion-token NOTION_DATABASE_ID=your-database-id
python app.py
The server will start on http://localhost:8000
with automatic background processing.
GET /
- Server statusGET /status
- Scheduler status and next run timesPOST /jobs/daily
- Manually trigger daily processingPOST /jobs/weekly
- Manually trigger weekly digestCreate a Notion integration:
Create a database:
Get the database ID:
Test the complete workflow:
python test_workflow.py
Trigger jobs manually via API:
# Daily processing curl -X POST http://localhost:8000/jobs/daily # Weekly digest curl -X POST http://localhost:8000/jobs/weekly # Check status curl http://localhost:8000/status
The system is designed to be simple and personal. It uses:
Perfect for personal newsletter management without production complexity.
MIT License - See LICENSE file for details.