Skip to main content

Architecture

newsworker is a thin CLI layer (core.py) over a service layer (service.py) that orchestrates:

ModuleRole
cache.pySHA-1-keyed file caches for specs and page content
extractor.pyDynamic date-driven feed extraction
spec.pyYAML spec serialization, SpecAnalyzer, SpecExtractor
finder.pyDiscovers existing feeds via autodiscovery/icons/heuristics
formats.pyRenders the internal feed dict to json/rss/atom/csv/opml/…
server.pyStdlib HTTP server exposing /feed, /health, /
settings.pyYAML-backed Settings dataclass
fetch.py / runtime.pyShared network policy and request context
delivery.pyWatch outbox and delivery channels
jsrender.pyOptional Playwright rendering
undated.pyOpt-in undated listing fallback
plugins.py / bridgesThird-party extractors and host/path YAML overrides

Typical data flow: get_feed(url) → ContentCache → fetch → SpecCache → SpecAnalyzer → SpecExtractor (fallback to dynamic FeedExtractor) → format_feed().

The internal feed dict is the API contract between extraction and output: {title, language, link, description, items: [{title, description, pubdate, unique_id, link, extra: {links, images}}]}.

See how it works and parsing specs.