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.6.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.6-cp312-cp312-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

feedparser_rs-0.1.6-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.6-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.6-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.6.tar.gz.

File metadata

  • Download URL: feedparser_rs-0.1.6.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.6.tar.gz
Algorithm Hash digest
SHA256 33be8ea9aa5f73f379cee30dcec205dd5680d2a2c444dfea0cf3910dcc4ffa88
MD5 bf7c59b2a9b81636bf55ff8b50eb7c31
BLAKE2b-256 77f7e2b13a85242745d69882ff1add2fc64624b7cc93cb8ccf80d9ad9b4c8d62

See more details on using hashes here.

Provenance

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

Publisher: release-pypi.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.6-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for feedparser_rs-0.1.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 48cb3fd09ee9dabfe6bc0814ce28200e261e624c02a4cd95b2b72ff6b8ee9919
MD5 52959a5585d97c1dd9d2ff6f02663dbf
BLAKE2b-256 9ff1e3880e472fc50aed6d5dded87175f0e6b6fefe0b292b59fdf2f7903c51ab

See more details on using hashes here.

Provenance

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

Publisher: release-pypi.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.6-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for feedparser_rs-0.1.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d6f68608e353fe15d59c92cfd5353033a350a291262206819d4fb0b27bed8afc
MD5 eb516be876ef74c6cc5152062595b17c
BLAKE2b-256 f1b1b7cfb157d70815ab8deb969f0d88213516bce5b393fcbb0013455eacacce

See more details on using hashes here.

Provenance

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

Publisher: release-pypi.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.6-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for feedparser_rs-0.1.6-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7cf04f25b17a12ff7587d414c90a98789649cee16ca13fb305399cd0a7f40725
MD5 b577ff7791466302f1f5216811e28bdb
BLAKE2b-256 9c17960221647f4f76741790ec6510ded8f2539c3499910887c6d3e87ffccd5b

See more details on using hashes here.

Provenance

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

Publisher: release-pypi.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.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for feedparser_rs-0.1.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fedd8cd43f44e64bd938b6b6f00c94877d4ba965d2293055ef415ba81e8ff984
MD5 cd4f6ac830c96fa47c96f372488d06fc
BLAKE2b-256 e9dcdc9fc80ab02cfc9d1113fa56931da91ca69cc95581af971afc3565d66696

See more details on using hashes here.

Provenance

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

Publisher: release-pypi.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.6-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for feedparser_rs-0.1.6-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 69895b3266e38d0fcc273c9a1adb94b2070eb00f86531b6bc75de4cb2b83b72c
MD5 d0fb5a82ddeb432a76d2ca48f9aec818
BLAKE2b-256 5655eaee6e28822e1e0609619cd101639bd8e8399ef61f839de61920968403ec

See more details on using hashes here.

Provenance

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

Publisher: release-pypi.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