Skip to content
GG
All projects

Nov 2026

Daily Digest: Automated News, Market, and Reading Briefing

A Python pipeline that collects news, US and Canadian market data, and a long-form article each morning, condenses them with an LLM, and emails a short briefing at 7:30. Runs unattended on GitHub Actions.

PythonGitHub ActionsDeepSeek APIJinja2SMTP
Pipeline diagram: RSS feeds and market APIs feed collectors, a DeepSeek processor in JSON mode, a Jinja2 renderer, and a Gmail SMTP sender, triggered daily by GitHub Actions

Problem

Every morning meant checking several news sites, two brokerage apps, and an English reading source. The goal was one email at breakfast with only what matters, and no manual steps.

Design

Four layers, each with one job. Only main.py connects them.

  • Collectors fetch data and return a common Item type. RSS feeds use timeouts, retries, and HTML cleanup. Market quotes try Finnhub first and fall back to yfinance, and an earnings calendar covers the next 7 days.
  • Processor calls DeepSeek in JSON mode for three tasks: rank and summarize news, comment on the market, and build an English reading lesson with sentence breakdowns.
  • Renderer fills a fixed Jinja2 template, producing an HTML email and a plain-text fallback.
  • Sender delivers through Gmail SMTP over SSL.

All sources, tickers, prompts, and model settings live in config.yaml. Secrets come only from environment variables.

Challenges

  • The LLM can make things up. It picks stories by ID number only, so links and prices come straight from the source. The model writes only the summaries and commentary.
  • Output shape varied day to day. Each task returns JSON that is checked against a required-keys schema. Malformed JSON gets one more try, and transient API errors retry with exponential backoff.
  • Stock data was unreliable. yfinance is often blocked on GitHub’s runners, so Finnhub is the primary source and yfinance the fallback.
  • GitHub’s cron ran up to 8 hours late. An external scheduler now starts the job at 7:30. The GitHub cron stays as a backup and skips itself if the email already went out that day.
  • Daylight saving time. GitHub cron is UTC only, so the backup has two slots and runs only the one that matches Toronto’s current offset.
  • Email clients are strict. Gmail ignores <style> tags, so all styling is inline and the layout uses tables.

Reliability

  • A failing feed, ticker, or LLM task logs a warning and is skipped. The email still goes out and marks the missing section.
  • --dry-run --mock-llm renders the full email without any API keys.