A personal daily digest that aggregates news, weather, sports, entertainment, and health data into a single mobile-friendly HTML email. A Python orchestrator calls six source modules that draw on eight external providers, the modules that need an LLM call it themselves, and the result lands in my inbox every morning — running locally or as a scheduled AWS Lambda.
Every morning the app assembles a personal briefing and emails it as a single, clean HTML message. Each section comes from a dedicated module so sources can be added or swapped without touching the others:
python main.py
or as an AWS Lambda triggered by EventBridge on a daily schedule — with a lambda_handler() entry
point and S3 holding state between runs.
main.py is the orchestrator: it calls each source module, then assembles and renders the email in plain Python
and sends it. Modules are independent and fail soft, so one flaky API doesn't sink the
whole digest. A failure while sending the mail does fail the run.
flowchart TD
accTitle: Daily Digest architecture
accDescr {
EventBridge triggers main.py on a daily schedule. main.py calls six source modules and gets their results back: news.py (Serper, or an OpenAI fallback), weather.py (NWS and Open-Meteo), sports.py (CricAPI and RSS feeds, no LLM), rugby.py (OpenAI hosted web search), movies.py (Tavily) and oura_pull.py (Oura API, with an S3-backed smart_cache.py). The modules that use an LLM (news, weather, rugby, movies and the Oura analysis) call it themselves; there is no central LLM step. main.py then renders the HTML and plain-text email in plain Python. An optional AI validator checks the rendered email, advisory only, and the email always sends through Gmail SMTP.
}
EB[EventBridge
daily schedule] --> M
M[main.py
orchestrator]
M <--> N[news.py
Serper or OpenAI fallback
uses LLM]
M <--> W[weather.py
NWS + Open-Meteo
uses LLM]
M <--> S[sports.py
CricAPI + RSS
no LLM]
M <--> R[rugby.py
OpenAI hosted web search
uses LLM]
M <--> MV[movies.py
Tavily
uses LLM]
M <--> O[oura_pull.py
Oura API
uses LLM analysis]
O <--> SC[smart_cache.py
S3-backed cache]
M --> H[render HTML + plain-text email
plain Python]
H --> V[AI validator
advisory only]
V --> G[Gmail SMTP send]
classDef llm fill:#fef3c7,stroke:#d97706,color:#000
class N,W,R,MV,O,V llm
Six source modules report back to the orchestrator, which renders the email in plain Python; the modules that need an LLM call it themselves, and an advisory validator checks the result before send.
Each module owns one topic, and some use more than one API (weather: NWS + Open-Meteo; sports: CricAPI + RSS). Six modules draw on eight external providers: Serper, NWS, Open-Meteo, CricAPI, BBC/ESPN RSS feeds, OpenAI hosted web search, Tavily and Oura. Each returns ready-to-render content to the orchestrator.
| Module | Source / API | Provides |
|---|---|---|
| news.py | Serper (Google search) while credits last, otherwise an OpenAI fallback | South Africa & Amazon news |
| weather.py | NWS + Open-Meteo | US & international forecasts |
| sports.py | CricAPI + RSS | SA cricket scores + sports feeds |
| rugby.py | OpenAI hosted web search | Springboks rugby news |
| movies.py | Tavily search | Top movies & TV shows |
| oura_pull.py | Oura API (analysis cached in S3) | Sleep, readiness & activity |
main.py calls the modules, then sanitises, renders, and sends the email. Token usage is tracked for the direct OpenAI calls, and the Oura analysis keeps its own cost estimate.
A lambda_handler() entry point runs the same code in the cloud; it is deployed as a zip package.
A scheduled rule fires the Lambda once a day so the digest arrives without any manual trigger.
LLM calls live inside the modules that need them, mostly gpt-4o-mini via the OpenAI Agents SDK, as agents with tools (the Oura analysis agent has about 11). An optional validator checks the final email's formatting, advisory only.
Holds state between Lambda runs — cached Oura metrics, analysis, and API usage counters.
Fetches only the days it is missing into an S3 file, analyses the last 90 days, and re-fetches the last few days each run to heal late data, and caches the AI analysis to reduce cost.
Assembles a MIME multipart message, with a plain-text copy alongside the HTML, and delivers the mobile-friendly email to the inbox.
Summaries are held to 2-4 sentences and regenerated if they get cut off, so the email stays tidy.
EventBridge triggers the Lambda (or a local cron / manual run) once a day to start the digest build.
The orchestrator calls each source module — news, weather, sports, rugby, movies, Oura — independently, so a single failing API degrades gracefully instead of breaking the run. A failure sending the mail does fail the run.
The modules that use an LLM condense noisy content themselves (cricket and RSS use none), with summaries held to 2-4 sentences. Links are relabelled with readable outlet names such as Reuters or News24, and URL and text sanitisers strip tracking params and de-dupe.
Oura history is back-filled around the API's single-day quirk; only missing days are fetched into an S3 file, and the cached analysis means repeat runs don't re-spend tokens.
All sections are assembled in plain Python into a mobile-friendly HTML template, with a plain-text copy, and packed into a MIME multipart message. An optional AI pass checks the formatting after rendering; it is advisory only and the email always sends.
The digest goes out via Gmail SMTP and lands in the inbox — one concise briefing instead of a morning of scattered reading.