Skip to main content

feedSummaryBase

Core library for intelligent RSS feed summarization with LLM support and advanced article tagging.

Features

  • RSS Feed Ingestion: Parse and fetch articles from RSS feeds with robust error handling
  • Intelligent Summarization: Generate summaries using local or cloud-based LLMs (Ollama)
  • Article Tagging System:
    • Automatic tag extraction and assignment using LLMs
    • Smart tag prioritization (prefer existing tags over new ones, general over specific)
    • Domain entity detection (CVE patterns, threat actors, regions, vulnerabilities)
    • Similarity matching for tag deduplication
  • Tag-Based Summary Generation: Create focused summaries from articles filtered by tags
  • Multi-Backend Persistence:
    • SQLite (production-grade SQL storage)
    • TinyDB (JSON-based storage for development)
  • Job Management: Track and resume summarization jobs
  • Batching & Chunking: Intelligent content batching with token budget management
  • Proofread & Revise: LLM-based quality improvement for generated summaries

Quick Start

Installation

pip install feedsummary-core

Basic Usage

import asyncio
from feedsummary_core.persistence import create_store
from feedsummary_core.llm_client import create_llm_client
from feedsummary_core.summarizer.main import run_pipeline

async def main():
    # Run the full pipeline: fetch RSS feeds → summarize → tag
    await run_pipeline("config.yaml")

asyncio.run(main())

Core Modules

Persistence Layer (persistence/)

NewsStore Protocol - Abstract interface for persistence backends

SqliteStore - Production-grade SQL backend

  • Indexed queries for optimal performance
  • Support for articles, summaries, jobs, and tags
  • WAL mode for concurrent access
  • Automatic table initialization
from feedsummary_core.persistence import create_store

store = create_store({"type": "sqlite", "path": "news.db"})
articles = store.get_articles()
tags = store.get_all_tags()

TinyDbStore - JSON-based backend (development)

  • File-based storage (news_docs.json)
  • No external dependencies
  • Complete feature parity with SqliteStore

LLM Client (llm_client/)

Unified interface for LLM interaction with support for multiple backends:

  • OllamaLocal - Local Ollama instance
  • OllamaCloud - Remote Ollama API
  • FallbackClient - Chain multiple LLM clients with fallback logic
from feedsummary_core.llm_client import create_llm_client

config = {
    "llm": {
        "provider": "ollama_local",
        "model": "mistral:latest",
        "temperature": 0.3,
    }
}

llm = create_llm_client(config)
response = await llm.chat(messages)

Summarization (summarizer/)

main.py - Primary orchestration

  • run_pipeline() - Full end-to-end workflow
  • run_resume_job() - Resume interrupted jobs
  • compose_summary_docs() - Generate composite summaries

summarizer.py - Core summarization engine

  • summarize_batches_then_meta_with_stats() - Batch processing
  • super_meta_from_topic_sections_with_stats() - Topic aggregation
  • _proofread_and_revise_meta_with_stats() - Quality improvement

tagging.py - TagManager class

  • Intelligent tag extraction and prioritization
  • Domain entity detection (CVE, threat actors, regions, vulnerabilities)
  • Similarity matching with configurable thresholds
  • LLM-based tag generation with structured prompts

tagging_integration.py - Pipeline integration

  • tag_articles() - Main tagging function
  • tag_articles_safe() - Non-blocking wrapper for pipeline
  • generate_summary_from_tags() - Create summaries from filtered articles
  • Automatic pipeline integration with error handling

ingest.py - RSS feed handling

  • gather_articles_to_store() - Fetch and process feeds
  • fetch_article_html() - Full-content extraction
  • Retry logic with exponential backoff

Configuration

Create a config.yaml file:

feeds:
  - url: "https://example.com/feed.xml"
    lookback: "48h"
    enabled: true

store:
  type: "sqlite"      # or "tinydb"
  path: "news.db"

llm:
  provider: "ollama_local"  # or "ollama_cloud", "fallback"
  model: "mistral:latest"
  temperature: 0.3
  base_url: "http://localhost:11434"

summarizer:
  max_tokens_per_article: 2000
  batch_size: 5
  max_retries: 3
  final_summary_lang: "svenska"

tagging:
  enabled: true
  max_tags_per_article: 5
  use_similarity_matching: true
  similarity_threshold: 0.6

Usage Examples

Summarization Pipeline

import asyncio
from feedsummary_core.summarizer.main import run_pipeline

# Run complete pipeline: fetch RSS → summarize → tag → save
async def main():
    await run_pipeline("config.yaml")

asyncio.run(main())

Article Tagging

import asyncio
from feedsummary_core.persistence import create_store
from feedsummary_core.llm_client import create_llm_client
from feedsummary_core.summarizer.tagging_integration import tag_articles

async def main():
    store = create_store(config.get("store", {}))
    llm = create_llm_client(config)
    
    # Tag existing articles
    result = await tag_articles(
        store=store,
        llm_client=llm,
        article_ids=["article_1", "article_2"],
        config=config
    )
    
    print(f"Tagged articles: {sum(1 for tags in result.values() if tags)}")

asyncio.run(main())

Tag-Based Summary Generation

import asyncio
from feedsummary_core.persistence import create_store
from feedsummary_core.llm_client import create_llm_client
from feedsummary_core.summarizer.tagging_integration import generate_summary_from_tags

async def main():
    store = create_store(config.get("store", {}))
    llm = create_llm_client(config)
    
    # Generate summary for all articles with "cybersecurity" tag
    summary = await generate_summary_from_tags(
        store=store,
        llm_client=llm,
        tag_names=["cybersecurity"],
        config=config,
        match_mode="any"  # "any" (OR) or "all" (AND)
    )
    
    if summary:
        print(f"Generated summary: {summary['title']}")
        print(f"Articles: {summary['article_count']}")
        store.save_summary_doc(summary)

asyncio.run(main())

Job Management

import asyncio
from feedsummary_core.summarizer.main import run_pipeline, run_resume_job

async def main():
    # Start new job
    job_id = await run_pipeline("config.yaml")
    
    # Resume interrupted job
    await run_resume_job(job_id, "config.yaml")

asyncio.run(main())

Architecture

Data Flow

RSS Feeds
   ↓
[Ingest] → Fetch articles, extract content
   ↓
[Store] → Save to persistence layer
   ↓
[Summarize] → Batch processing, LLM summarization
   ↓
[Tag] → Extract & assign tags (automatic in pipeline)
   ↓
[Refine] → Proofread and improve summaries
   ↓
[Persist] → Save summaries with metadata

Module Dependencies

persistence/          - Abstract store interface
  ├── SqliteStore
  └── TinyDbStore

llm_client/          - LLM abstraction
  ├── OllamaLocal
  ├── OllamaCloud
  └── FallbackClient

summarizer/
  ├── main.py       - Pipeline orchestration
  ├── summarizer.py - Summarization engine
  ├── tagging.py    - Tag management
  ├── tagging_integration.py - Pipeline integration
  ├── ingest.py     - Feed fetching
  ├── batching.py   - Chunk management
  └── helpers.py    - Utilities

Documentation

For detailed information, see:

Requirements

  • Python >= 3.10
  • SQLite >= 3.x (for SqliteStore)
  • Local Ollama or cloud Ollama access
  • RSS feed URLs

Dependencies

Key dependencies (see pyproject.toml for full list):

  • aiohttp - Async HTTP client
  • feedparser - RSS feed parsing
  • tenacity - Retry logic
  • tinydb - JSON storage
  • PyYAML - Configuration files
  • trafilatura - Content extraction
  • ollama - Ollama client

License

BSD 3-Clause License - See LICENSE file for details

Metadata

Release files for feedsummary-core 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for feedsummary-core 2.1.0
File Size Uploaded Provenance Actions
feedsummary_core-2.1.0.tar.gz 109.5 kB With provenance Details for feedsummary_core-2.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for feedsummary-core 2.1.0
File Interpreter ABI Platform Actions
feedsummary_core-2.1.0-py3-none-any.whl Python 3 none any Details for feedsummary_core-2.1.0-py3-none-any.whl

Total release size: 225.8 kB

Release files / feedsummary_core-2.1.0.tar.gz

Download URL feedsummary_core-2.1.0.tar.gz
Size 109.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a02680c979e812733c75674b229ddfb53643039fc27dae737e480ed28320f201
BLAKE2b-256 checksum
How to use checksums
97396d6f1a8becb077f6427efa42d910b726154fa323d5a1515830471768745b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.

Transparency log

Release files / feedsummary_core-2.1.0-py3-none-any.whl

Download URL feedsummary_core-2.1.0-py3-none-any.whl
Size 116.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
511eeeae5d6fe7ccd88281a13b79362de2c31e23509618350f2ce068df58afe9
BLAKE2b-256 checksum
How to use checksums
e23716d48b8ce75f82abd8d9887aaa7bb8ab43ddea4c993fb4a5620c951d3c9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.

Transparency log

Security for feedsummary-core 2.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for feedsummary_core-2.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page