feedparser
Parses RSS, Atom, RDF, CDF, and JSON feeds into one normalized Python dictionary.
Repository Health
Technical Analysis
feedparser is a Python library that parses virtually every version and dialect of syndicated feed in use since 1999 — every version of RSS, all flavors of Atom, RDF, CDF, and, as of version 6, JSON feeds — normalizing all of them into the same predictable dictionary-like structure. It handles format and version detection automatically, so you hand it a URL, local file, open stream, or raw string and get back one consistent FeedParserDict, regardless of whether the source publishes RSS 0.91 from 2001 or Atom 1.0 today.
Beyond parsing, feedparser resolves relative links against the feed’s base URI, sanitizes HTML found in entry content and summaries, detects and converts inconsistent or mislabeled character encodings, and normalizes non-standard date formats across dozens of known variations. It ships built-in support for common extension namespaces — Dublin Core, iTunes podcasting tags, Media RSS, GeoRSS, Creative Commons, and Podlove Simple Chapters — so extension-specific fields show up in the same normalized result.
What You Get
- Universal feed parsing - A single
parse()function handles RSS 0.90 through 2.0, Atom 0.3/1.0, RDF, CDF, and JSON feeds via automatic format and version detection. - Normalized FeedParserDict output - Every feed type maps onto the same dict-like interface, so downstream code doesn’t need per-format branching.
- Built-in HTML sanitization - Strips unsafe markup from summary/content fields using an internal sanitizer before it reaches your application.
- Robust encoding handling - Detects and converts inconsistent or mislabeled character encodings, including legacy cp1252 fallbacks.
- Extension namespace support - Ships parsers for Dublin Core, iTunes, Media RSS, GeoRSS, Creative Commons, and Podlove Simple Chapters namespaces.
Common Use Cases
- Building an RSS reader - Fetch and normalize feeds from arbitrary publishers without writing per-format parsing logic.
- Podcast app feed ingestion - Parse iTunes and Media RSS extension tags (episode artwork, duration, enclosures) directly from feed entries.
- Content aggregation pipelines - Pull articles from many blogs and news sources into one schema for indexing or deduplication.
- Monitoring malformed feeds - Use the
bozoflag andbozo_exceptionto detect and gracefully handle ill-formed XML from real-world feed publishers.
Under The Hood
Architecture
feedparser is organized as a thin api.py orchestration layer over three cooperating subsystems: format-specific parsers in parsers/ (strict.py for well-formed XML via xml.sax, loose.py built on an SGML-derived fallback for malformed markup, and json.py for JSON Feed), a namespaces/ package where each supported extension (Dublin Core, iTunes, Media RSS, GeoRSS, Creative Commons, Podlove) is its own mixin class composed onto a shared Namespace base, and cross-cutting concern modules (encodings.py, sanitizer.py, urls.py, datetimes.py) that every parser calls into. mixin.py’s XMLParserMixin ties the namespace mixins and SAX handling together so a new extension can be added by writing one namespace module rather than touching the core parser — a plugin-style design that has let the library absorb two decades of real-world RSS/Atom variants without a rewrite.
Tech Stack
Pure Python with a deliberately small dependency footprint: the standard library’s xml.sax and urllib do the heavy lifting, with feedparser-sgmllib supplying the permissive SGML parser used for the loose fallback path and requests used for optional network fetches. The project builds with poetry-core via pyproject.toml, ships a py.typed marker for type-checker consumers, and is tested across Python 3.10 through the 3.15 beta using tox.
Code Quality
The project has an extensive test suite (15 top-level test modules covering encoding, entities, ill-formed feeds, JSON parsing, sanitization, and date parsing, plus dedicated tests/encoding, tests/entities, tests/illformed, and tests/json fixture directories) run in CI (.github/workflows/test.yaml) across multiple Python versions on Linux. pyproject.toml configures mypy for static type checking, flake8/isort for linting, and a coverage gate (fail_under = 93), indicating a mature, actively enforced quality bar rather than ad hoc testing.
What Makes It Unique
feedparser’s differentiator isn’t novel architecture — it’s two decades of accumulated tolerance for the real world’s inconsistent feed formats. Its dual strict/loose parsing strategy, explicit bozo flag for surfacing (rather than hiding) malformed input, and per-extension namespace plugin system make it able to extract usable data from feeds that would break a naive XML parser, which is precisely why it remains the default choice for feed ingestion in the Python ecosystem.
Used by 8 apps in this directory
Airbyte
Developer Tools · Data Engineering
Open-source ELT platform with 600+ connectors for moving data from any source to warehouses, lakes, and AI agents.
ART
AI Development
Give your LLM agents on-the-job training—ART lets you apply GRPO reinforcement learning to any multi-step agentic workflow with minimal code changes.
auto-news
AI Assistants · Productivity
An AI-powered personal news aggregator that filters multi-source feeds through LLMs and delivers curated, noise-free summaries to your Notion workspace.
AutoGPT
Automation · Productivity · AI Assistants
Build, deploy, and run autonomous AI agents that automate complex multi-step workflows using a visual block-based graph editor.
changedetection.io
Monitoring
Self-hosted website change detection with AI-powered smart alerts, browser automation, price tracking, and 85+ notification channels.
Glean
Knowledge Management · Bookmarks Archiving
Self-hosted RSS reader and personal knowledge management tool with MCP server integration for AI assistant connectivity.
GPT Researcher
Productivity · AI Assistants
The pioneering open-source autonomous AI agent that conducts deep, multi-source research and produces citation-backed reports exceeding 2,000 words — faster and more reliably than any human researcher.
OpenViking
Databases · AI Development
An open-source context database that gives AI agents a unified filesystem for memory, resources, and skills with hierarchical tiered retrieval.