Skip to content

API Reference parrot_tools.rss.toolkit

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.rss.toolkit

View source

RSS Feed Reader Toolkit.

Reads a configurable list of RSS/Atom feeds, fetches the COMPLETE page content of every linked article (aiohttp first, Selenium fallback for JS-heavy pages — the fallback needs the scraping extra), and archives raw HTML + extracted text on disk. The LLM only receives per-item metadata dictionaries carrying the paths of the archived files, never the page content itself; rss_get_content reads archived content on demand.

Feed parsing requires the rss extra: pip install ai-parrot-tools[rss].

Alias ArticleFetcher

Re-exported from parrot_tools.rss.fetcher.ArticleFetcher.

Attribute FeedConfig

Alias FeedItemMetadata

Re-exported from parrot_tools.rss.models.FeedItemMetadata.

Alias FeedSite

Re-exported from parrot_tools.rss.models.FeedSite.

Alias GetContentInput

Re-exported from parrot_tools.rss.models.GetContentInput.

Alias HAS_FEEDPARSER

Re-exported from parrot_tools.rss.fetcher.HAS_FEEDPARSER.

Class RSSFeedReaderToolkit

Toolkit that archives RSS feed articles to disk for later retrieval.

Parameter Type Default Description
feeds Optional[Sequence[FeedConfig]] None Feed list — plain URLs, dicts of :class:FeedSite fields (url, name, max_items, use_browser), or FeedSite instances.
storage_dir Optional[Union[str, Path]] None Archive root. Defaults to OUTPUT_DIR/rss_feeds.
max_items_per_feed int 10 Default cap on items processed per feed.
concurrency int 10 Max concurrent aiohttp requests across all feeds.
browser_concurrency int 2 Max concurrent Selenium fallback slots.
min_text_length int 500 Extracted-text length under which a page is considered JS-rendered and retried in the browser.
request_timeout int 30 Per-request timeout in seconds.
use_browser_fallback bool True Disable to never launch a browser.
browser str 'chrome' Selenium browser type for the fallback.
headless bool True Run the fallback browser headless.
**kwargs {}

Attributes:

Attribute Type Description
feeds List[FeedSite]

Method RSSFeedReaderToolkit.start

Create the HTTP session, semaphores, and article fetcher.

start() -> None

Method RSSFeedReaderToolkit.stop

Close the fetcher (Selenium driver) and the HTTP session.

stop() -> None

Method RSSFeedReaderToolkit.read_feeds

Fetch RSS feeds and archive the full content of every linked article.

Reads the configured feeds (plus any ad-hoc feed_urls) concurrently, downloads the complete page of each item, and saves raw HTML and extracted text to disk. Returns one metadata dictionary per item (title, link, published, summary, item_id, html_path, text_path, fetch_status) — never the article content itself. Use rss_get_content with an item_id to read an article's content.

read_feeds(feed_urls: Optional[List[str]] = None, max_items: Optional[int] = None, force_refresh: bool = False) -> List[Dict[str, Any]]

Parameter Type Default Description
feed_urls Optional[List[str]] None Optional additional feed URLs to read alongside the configured feeds.
max_items Optional[int] None Cap on items processed per feed for this call.
force_refresh bool False Re-download items that are already archived.

Returns: List[Dict[str, Any]] — A list of item metadata dictionaries.

Method RSSFeedReaderToolkit.get_content

Retrieve the archived content of a previously fetched article.

get_content(item: str, format: str = 'text', max_chars: int = 20000) -> Dict[str, Any]

Parameter Type Default Description
item str The 16-char item_id returned by rss_read_feeds, or a saved html_path/text_path.
format str 'text' 'text' for the extracted article text, 'html' for the raw page HTML.
max_chars int 20000 Maximum number of characters to return.

Returns: Dict[str, Any] — A dict with keys item, format, content, and truncated — or an error dict when the item is unknown or the path is invalid.

Method RSSFeedReaderToolkit.list_feeds

List the RSS feeds this toolkit is configured to read.

list_feeds() -> List[Dict[str, Any]]

Returns: List[Dict[str, Any]] — One dict per configured feed with url, name, slug, max_items, and use_browser.

Method RSSFeedReaderToolkit.list_saved

List previously archived feed items, newest first.

list_saved(feed: Optional[str] = None, limit: int = 50) -> List[Dict[str, Any]]

Parameter Type Default Description
feed Optional[str] None Optional feed slug to filter by (see rss_list_feeds).
limit int 50 Maximum number of items to return.

Returns: List[Dict[str, Any]] — A list of archived item metadata dictionaries.

Alias RSSStorage

Re-exported from parrot_tools.rss.storage.RSSStorage.

Alias SUMMARY_MAX_CHARS

Re-exported from parrot_tools.rss.models.SUMMARY_MAX_CHARS.

Alias extract_text

Re-exported from parrot_tools.rss.fetcher.extract_text.

Alias make_item_id

Re-exported from parrot_tools.rss.models.make_item_id.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally