Skip to main content

High-performance RSS/Atom/JSON Feed parser with feedparser-compatible API

Project description

feedparser-rs

High-performance RSS/Atom/JSON Feed parser for Python with feedparser-compatible API.

Features

  • Fast: Native Rust implementation via PyO3
  • Tolerant parsing: Bozo flag for graceful handling of malformed feeds
  • Multi-format: RSS 0.9x/1.0/2.0, Atom 0.3/1.0, JSON Feed 1.0/1.1
  • Podcast support: iTunes and Podcast 2.0 namespace extensions
  • Familiar API: Inspired by feedparser, easy migration path
  • DoS protection: Built-in resource limits

Installation

pip install feedparser-rs

Usage

import feedparser_rs

# Parse from string or bytes
d = feedparser_rs.parse('<rss>...</rss>')
d = feedparser_rs.parse(b'<rss>...</rss>')

# Access data
print(d.feed.title)
print(d.version)  # "rss20", "atom10", etc.
print(d.bozo)     # True if parsing errors occurred

for entry in d.entries:
    print(entry.title)
    print(entry.published_parsed)  # time.struct_time

Migration from feedparser

# Option 1: alias import
import feedparser_rs as feedparser
d = feedparser.parse(feed_content)

# Option 2: direct import
import feedparser_rs
d = feedparser_rs.parse(feed_content)

Note: URL fetching is not yet implemented. Use requests.get(url).content to fetch feeds.

Advanced Usage

Custom Resource Limits

import feedparser_rs

limits = feedparser_rs.ParserLimits(
    max_feed_size_bytes=50_000_000,  # 50 MB
    max_entries=5_000,
    max_authors=20,
    max_links_per_entry=50,
)

d = feedparser_rs.parse_with_limits(feed_data, limits)

Format Detection

import feedparser_rs

version = feedparser_rs.detect_format(feed_data)
print(version)  # "rss20", "atom10", "json11", etc.

Podcast Support

import feedparser_rs

d = feedparser_rs.parse(podcast_feed)

# iTunes metadata
if d.feed.itunes:
    print(d.feed.itunes.author)
    print(d.feed.itunes.categories)

# Episode metadata
for entry in d.entries:
    if entry.itunes:
        print(f"Duration: {entry.itunes.duration}s")

API Reference

Functions

  • parse(source) — Parse feed from bytes or str
  • parse_with_limits(source, limits) — Parse with custom resource limits
  • detect_format(source) — Detect feed format without full parsing

Classes

  • FeedParserDict — Parsed feed result

    • .feed — Feed metadata
    • .entries — List of entries
    • .bozo — True if parsing errors occurred
    • .version — Feed version string
    • .encoding — Character encoding
  • ParserLimits — Resource limits configuration

Requirements

  • Python >= 3.9

Development

git clone https://github.com/bug-ops/feedparser-rs
cd feedparser-rs/crates/feedparser-rs-py
pip install maturin
maturin develop

License

MIT OR Apache-2.0

Links

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

feedparser_rs-0.1.7.tar.gz (92.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

feedparser_rs-0.1.7-cp312-cp312-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.12Windows x86-64

feedparser_rs-0.1.7-cp312-cp312-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

feedparser_rs-0.1.7-cp312-cp312-macosx_10_12_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

feedparser_rs-0.1.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

feedparser_rs-0.1.7-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.8 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ ARM64

File details

Details for the file feedparser_rs-0.1.7.tar.gz.

File metadata

  • Download URL: feedparser_rs-0.1.7.tar.gz
  • Upload date:
  • Size: 92.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for feedparser_rs-0.1.7.tar.gz
Algorithm Hash digest
SHA256 4840af9cc04d7ce4ff74010971ce7b200189caa1ccc0eec57296f1e3f6a962c9
MD5 5071437a2332edd327ecac897f7a96f0
BLAKE2b-256 bdb8d25689f76209b8474a20f8e2ee7dd1952d475693d4ce6105a14bd1a8a6d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for feedparser_rs-0.1.7.tar.gz:

Publisher: release.yml on bug-ops/feedparser-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file feedparser_rs-0.1.7-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for feedparser_rs-0.1.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b58931d2df3d27b4c31bc4cc7b78aa5a9e52247b8334c4c61f0894a88b9790ae
MD5 8f4e4ad713153c1ad3d0c6b8b0142aa3
BLAKE2b-256 d6f91fb70942346b53a18fa12220d35dfc2af19953aebb0eac4409e60233db85

See more details on using hashes here.

Provenance

The following attestation bundles were made for feedparser_rs-0.1.7-cp312-cp312-win_amd64.whl:

Publisher: release.yml on bug-ops/feedparser-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file feedparser_rs-0.1.7-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for feedparser_rs-0.1.7-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5fae44951a7bb03a35b7834c11dc5f357a64f47b08721fc7647e80095482a3aa
MD5 1bbb73c135ebd3072c71eb97c149c1d1
BLAKE2b-256 62d98a6acdd9352648931d030b491ef20563452366fbd27adef5c9d48f347584

See more details on using hashes here.

Provenance

The following attestation bundles were made for feedparser_rs-0.1.7-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on bug-ops/feedparser-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file feedparser_rs-0.1.7-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for feedparser_rs-0.1.7-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5d515050acbd336ed1723b0e3c6b013d24fee59aa1dd1f37d1fa4864b5772a3a
MD5 e59e603fb62f396fde7a497a84acd409
BLAKE2b-256 a94b04555d5e0bd6eab8b5c9e6cbff413655ee9a9006c7437e777e85eacc9121

See more details on using hashes here.

Provenance

The following attestation bundles were made for feedparser_rs-0.1.7-cp312-cp312-macosx_10_12_x86_64.whl:

Publisher: release.yml on bug-ops/feedparser-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file feedparser_rs-0.1.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for feedparser_rs-0.1.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cb209ac875c588355530101815a8429528d2bc1c66be54aa8d61fffa62c5e576
MD5 937c5a7bdc2805eba62537babe9ffd6e
BLAKE2b-256 1757615033f5eea00b889bbe670c0fca0c25ab326e1c25084fee786d10f0f2ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for feedparser_rs-0.1.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on bug-ops/feedparser-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file feedparser_rs-0.1.7-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for feedparser_rs-0.1.7-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 48ff54e657884eabe3049952e3257808be5009f37e07c810f4cbde6befda444a
MD5 e78185a7e865dc738ccc9b783ef8ac63
BLAKE2b-256 b2e99e8087c8a2c3e64b8424c1df29e64e272900a5ff6bcde119953dc4ce73a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for feedparser_rs-0.1.7-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on bug-ops/feedparser-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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