How cosmix-6/info-snipe works
info-snipe is a Python library and CLI for fetching news by genre and country, normalizing results, and returning only unseen articles. The main workflow is to configure a genre, fetch from RSS and optionally NewsAPI, assign stable content identities, filter against persistent seen-state, then return or display fresh articles. SQLite is the default store; Postgres is an optional alternative backend. The graph reflects the sampled implementation and documented capabilities; the Postgres injection path is shown as unverified because its wiring was not excerpted.
Main entry points: fetcher.py News fetcher · cli.py CLI · __init__.py Default factory · rss_source.py RSS adapter
Components 16
Entry and output
- CLI
info_snipe/cli.py - Default factory
info_snipe/__init__.py - Terminal output
info_snipe/cli.py
News retrieval
- News fetcher
info_snipe/fetcher.py - Genre registry
info_snipe/genres.py - Source contract
info_snipe/sources/base.py - RSS adapter
info_snipe/sources/rss_source.py - NewsAPI adapter
info_snipe/sources/newsapi_source.py
Identity and seen state
- Article model
info_snipe/models.py - Content identity
info_snipe/content_id.py - SQLite seen store
info_snipe/store.py - Postgres seen store
info_snipe/store_postgres.py
Other components
- Library user
- CLI user
- RSS feeds
- NewsAPI service
Connections 23
- Library user → News fetcher: calls fetch
README.md - CLI user → CLI: runs
README.md - CLI → Default factory: builds fetcher
info_snipe/cli.py - CLI → Genre registry: lists choices
info_snipe/cli.py - Default factory → News fetcher: constructs
info_snipe/__init__.py - Default factory → RSS adapter: includes
info_snipe/__init__.py - Default factory → NewsAPI adapter: adds when keyed
info_snipe/__init__.py - Default factory → SQLite seen store: creates default
info_snipe/__init__.py - News fetcher → Genre registry: resolves genre
info_snipe/fetcher.py - News fetcher → Source contract: dispatches fetch
info_snipe/fetcher.py - RSS adapter → Source contract: implements
info_snipe/sources/rss_source.py - NewsAPI adapter → Source contract: implements
info_snipe/sources/newsapi_source.py - RSS adapter → Genre registry: reads feed config
info_snipe/sources/rss_source.py - NewsAPI adapter → Genre registry: reads query config
info_snipe/sources/newsapi_source.py - RSS adapter → RSS feeds: fetches feeds
info_snipe/sources/rss_source.py - NewsAPI adapter → NewsAPI service: requests articles
info_snipe/sources/newsapi_source.py - News fetcher → Content identity: creates IDs
info_snipe/fetcher.py - News fetcher → Article model: normalizes into
info_snipe/fetcher.py - News fetcher → SQLite seen store: filters and records
info_snipe/fetcher.py - News fetcher → Postgres seen store: accepts compatible store
- CLI → News fetcher: fetches articles
info_snipe/cli.py - CLI → Terminal output: prints results
info_snipe/cli.py - News fetcher → Library user: returns articles
README.md