Skip to main content

High performance RSS, Atom and RDF parser in Python

Project description

FastFeedParser

A high-performance RSS, Atom, and RDF feed parser for Python. FastFeedParser is designed to be fast, memory-efficient, and easy to use while providing comprehensive feed parsing capabilities.

Why FastFeedParser?

The main advantage of FastFeedParser over the traditional feedparser library is its lightweight design and exceptional performance - benchmarks show it's 10x-100x faster than feedparser while maintaining a familiar API. This dramatic speed improvement is achieved through:

  • Efficient XML parsing using lxml
  • Optimized memory usage
  • Minimal dependencies
  • Streamlined codebase focused on core functionality

Features

  • 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 with timezone handling
  • Clean, Pythonic API similar to feedparser
  • Comprehensive handling of feed metadata
  • Support for various feed extensions (Media RSS, Dublin Core, etc.)

Installation

pip install fastfeedparser

Quick Start

import fastfeedparser

# Parse from URL
feed = fastfeedparser.parse_url('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>'''
feed = fastfeedparser.parse(xml_content)

# Access feed information
print(feed.feed.title)
print(feed.feed.link)

# Access entries
for entry in feed.entries:
    print(entry.title)
    print(entry.link)
    print(entry.published)

Key Features

Feed Types Support

  • RSS 2.0
  • Atom 1.0
  • RDF/RSS 1.0

Content Handling

  • Automatic encoding detection
  • HTML content parsing
  • Media content extraction
  • Enclosure handling

Metadata Support

  • Feed title, link, and description
  • Publication dates
  • Author information
  • Categories and tags
  • Media content and thumbnails

API Reference

Main Functions

  • parse(xml_content): Parse feed from a string or bytes
  • parse_url(url): Parse feed from a URL
  • fetch_url(url): Fetch content from a URL

Feed Object Structure

The parser returns a FastFeedParserDict object with two main sections:

  • feed: Contains feed-level metadata
  • entries: List of feed entries

Each entry contains:

  • title: Entry title
  • link: Entry URL
  • description: Entry description/summary
  • published: Publication date
  • author: Author information
  • content: Full content
  • media_content: Media attachments
  • enclosures: Attached files

Requirements

  • Python 3.7+
  • httpx
  • lxml
  • parsedatetime
  • python-dateutil

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Inspired by the Universal Feed Parser (feedparser) project, FastFeedParser aims to provide a modern, high-performance alternative while maintaining a familiar API.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastfeedparser-0.1.0.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

fastfeedparser-0.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file fastfeedparser-0.1.0.tar.gz.

File metadata

  • Download URL: fastfeedparser-0.1.0.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for fastfeedparser-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dc060005e5d52a3541092e23afb63b61f071a52868604a047cc6f7f633528aef
MD5 429f60db3bef1afbb98fb1a3ce3b4983
BLAKE2b-256 6a5a73de5482d8e45de2b70dd0128fbe5845b51dc7702ca7f48a3d2b697ef8d1

See more details on using hashes here.

File details

Details for the file fastfeedparser-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fastfeedparser-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 80ad55744f4ae57ca546deb7a219b2b19f6b6b6e95ec536567fe485be043f32e
MD5 4ed1abc1468f37080c2afaa1df5144d8
BLAKE2b-256 c0139e6c8fca4bcbb1e58101fc0e44021205af320ab4ed9780dd15776fd06359

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page