A high-performance feed parser for Python that handles RSS, Atom, and RDF. Built for speed, efficiency, and ease of use while delivering complete parsing capabilities.
It's 10x-100x faster than traditional feedparser while keeping a familiar API. This speed comes from:
- lxml for efficient XML parsing
- Smart memory management
- Minimal dependencies
- Focused, streamlined code
Powers feed processing for Kagi Small Web, handling processing of thousands of feeds at scale.
- Fast parsing of RSS 2.0, Atom 1.0, and RDF/RSS 1.0 feeds
- Robust error handling and encoding detection
- Support for media content and enclosures
- Automatic date parsing and standardization to UTC ISO 8601 format
- Clean, Pythonic API similar to feedparser
- Comprehensive handling of feed metadata
- Support for various feed extensions (Media RSS, Dublin Core, etc.)
pip install fastfeedparser
import fastfeedparser
# Parse from URL
myfeed = fastfeedparser.parse('https://example.com/feed.xml')
# Parse from string
xml_content = '''<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>Example Feed</title>
...
</channel>
</rss>'''
myfeed = fastfeedparser.parse(xml_content)
# Access feed global information
print(myfeed.feed.title)
print(myfeed.feed.link)
# Access feed entries
for entry in myfeed.entries:
print(entry.title)
print(entry.link)
print(entry.published)
- RSS 2.0
- Atom 1.0
- RDF/RSS 1.0
- Automatic encoding detection
- HTML content parsing
- Media content extraction
- Enclosure handling
- Feed title, link, and description
- Publication dates
- Author information
- Categories and tags
- Media content and thumbnails
parse(source)
: Parse feed from a source that can be URL or a string
The parser returns a FastFeedParserDict
object with two main sections:
feed
: Contains feed-level metadataentries
: List of feed entries
Each entry contains:
title
: Entry titlelink
: Entry URLdescription
: Entry description/summarypublished
: Publication dateauthor
: Author informationcontent
: Full contentmedia_content
: Media attachmentsenclosures
: Attached files
- Python 3.7+
- httpx
- lxml
- parsedatetime
- python-dateutil
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Inspired by the Universal Feed Parser (feedparser) project, FastFeedParser aims to provide a modern, high-performance alternative while maintaining a familiar API.