# FastFeedParser
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.
### Why FastFeedParser?
It's about 10x faster (check included `benchmark.py`) than popular feedparser
library 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](https://github.com/kagisearch/smallweb), handling processing of thousands of feeds at scale.
## 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 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.)
## Installation
```bash
pip install fastfeedparser
```
## Quick Start
```python
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)
```
## Run Benchmark
```bash
python benchmark.py
```
This will run benchmark on a number of feeds with output looking like this
```
Testing https://gessfred.xyz/rss.xml
FastFeedParser: 17 entries in 0.004s
Feedparser: 17 entries in 0.098s
Speedup: 26.3x
Testing https://fanf.dreamwidth.org/data/rss
FastFeedParser: 25 entries in 0.005s
Feedparser: 25 entries in 0.087s
Speedup: 17.9x
Testing https://jacobwsmith.xyz/feed.xml
FastFeedParser: 121 entries in 0.030s
Feedparser: 121 entries in 0.166s
Speedup: 5.5x
Testing https://bernsteinbear.com/feed.xml
FastFeedParser: 11 entries in 0.007s
Feedparser: 11 entries in 0.339s
Speedup: 50.1x
```
## 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(source)`: Parse feed from a source that can be URL or a string
### 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+
- dateparser
- lxml
- 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 [feedparser](https://github.com/kurtmckee/feedparser) project, FastFeedParser aims to provide a modern, high-performance alternative while maintaining a familiar API.
Raw data
{
"_id": null,
"home_page": "https://github.com/kagisearch/fastfeedparser",
"name": "fastfeedparser",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": null,
"author": "Vladimir Prelovac",
"author_email": "vlad@kagi.com",
"download_url": "https://files.pythonhosted.org/packages/ef/d7/d520cd0bbc486bf1546d2c1be9337ed07ef201539ce74996f38eb239f07b/fastfeedparser-0.3.7.tar.gz",
"platform": null,
"description": "# FastFeedParser\n\nA 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.\n\n### Why FastFeedParser?\n\nIt's about 10x faster (check included `benchmark.py`) than popular feedparser\nlibrary while keeping a familiar API. This speed comes from:\n\n- lxml for efficient XML parsing\n- Smart memory management \n- Minimal dependencies\n- Focused, streamlined code\n\nPowers feed processing for [Kagi Small Web](https://github.com/kagisearch/smallweb), handling processing of thousands of feeds at scale.\n\n\n## Features\n\n- Fast parsing of RSS 2.0, Atom 1.0, and RDF/RSS 1.0 feeds\n- Robust error handling and encoding detection\n- Support for media content and enclosures\n- Automatic date parsing and standardization to UTC ISO 8601 format\n- Clean, Pythonic API similar to feedparser\n- Comprehensive handling of feed metadata\n- Support for various feed extensions (Media RSS, Dublin Core, etc.)\n\n\n## Installation\n\n```bash\npip install fastfeedparser\n```\n\n## Quick Start\n\n```python\nimport fastfeedparser\n\n# Parse from URL\nmyfeed = fastfeedparser.parse('https://example.com/feed.xml')\n\n# Parse from string\nxml_content = '''<?xml version=\"1.0\"?>\n<rss version=\"2.0\">\n <channel>\n <title>Example Feed</title>\n ...\n </channel>\n</rss>'''\nmyfeed = fastfeedparser.parse(xml_content)\n\n# Access feed global information\nprint(myfeed.feed.title)\nprint(myfeed.feed.link)\n\n# Access feed entries\nfor entry in myfeed.entries:\n print(entry.title)\n print(entry.link)\n print(entry.published)\n```\n\n## Run Benchmark\n\n```bash\npython benchmark.py\n```\n\nThis will run benchmark on a number of feeds with output looking like this\n\n```\nTesting https://gessfred.xyz/rss.xml\nFastFeedParser: 17 entries in 0.004s\nFeedparser: 17 entries in 0.098s\nSpeedup: 26.3x\n\nTesting https://fanf.dreamwidth.org/data/rss\nFastFeedParser: 25 entries in 0.005s\nFeedparser: 25 entries in 0.087s\nSpeedup: 17.9x\n\nTesting https://jacobwsmith.xyz/feed.xml\nFastFeedParser: 121 entries in 0.030s\nFeedparser: 121 entries in 0.166s\nSpeedup: 5.5x\n\nTesting https://bernsteinbear.com/feed.xml\nFastFeedParser: 11 entries in 0.007s\nFeedparser: 11 entries in 0.339s\nSpeedup: 50.1x\n```\n\n\n## Key Features\n\n### Feed Types Support\n- RSS 2.0\n- Atom 1.0\n- RDF/RSS 1.0\n\n### Content Handling\n- Automatic encoding detection\n- HTML content parsing\n- Media content extraction\n- Enclosure handling\n\n### Metadata Support\n- Feed title, link, and description\n- Publication dates\n- Author information\n- Categories and tags\n- Media content and thumbnails\n\n## API Reference\n\n### Main Functions\n\n- `parse(source)`: Parse feed from a source that can be URL or a string\n\n\n### Feed Object Structure\n\nThe parser returns a `FastFeedParserDict` object with two main sections:\n\n- `feed`: Contains feed-level metadata\n- `entries`: List of feed entries\n\nEach entry contains:\n- `title`: Entry title\n- `link`: Entry URL\n- `description`: Entry description/summary\n- `published`: Publication date\n- `author`: Author information\n- `content`: Full content\n- `media_content`: Media attachments\n- `enclosures`: Attached files\n\n## Requirements\n\n- Python 3.7+\n- dateparser\n- lxml\n- python-dateutil\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Acknowledgments\n\nInspired by the [feedparser](https://github.com/kurtmckee/feedparser) project, FastFeedParser aims to provide a modern, high-performance alternative while maintaining a familiar API.\n",
"bugtrack_url": null,
"license": null,
"summary": "High performance RSS, Atom and RDF parser in Python",
"version": "0.3.7",
"project_urls": {
"Bug Tracker": "https://github.com/kagisearch/fastfeedparser/issues",
"Homepage": "https://github.com/kagisearch/fastfeedparser"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5ab178c89b0ef50cde8e5b9813f5b27f546e32b6c8207141dbb99626295ac267",
"md5": "88490dfae2ae8a0b8d915aefff398c25",
"sha256": "e88938dd4e17a8756bff87a0541653cf928c5235fffeb25a58b70656f0f8e98e"
},
"downloads": -1,
"filename": "fastfeedparser-0.3.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "88490dfae2ae8a0b8d915aefff398c25",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 10285,
"upload_time": "2025-04-01T02:41:43",
"upload_time_iso_8601": "2025-04-01T02:41:43.734363Z",
"url": "https://files.pythonhosted.org/packages/5a/b1/78c89b0ef50cde8e5b9813f5b27f546e32b6c8207141dbb99626295ac267/fastfeedparser-0.3.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "efd7d520cd0bbc486bf1546d2c1be9337ed07ef201539ce74996f38eb239f07b",
"md5": "67b981e7b0717b0950e9668270f6e2bd",
"sha256": "73bd2823795c12d449fa2cd29420638d3a6d77f8004e44f1d7c52761f6236709"
},
"downloads": -1,
"filename": "fastfeedparser-0.3.7.tar.gz",
"has_sig": false,
"md5_digest": "67b981e7b0717b0950e9668270f6e2bd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 12256,
"upload_time": "2025-04-01T02:41:44",
"upload_time_iso_8601": "2025-04-01T02:41:44.621842Z",
"url": "https://files.pythonhosted.org/packages/ef/d7/d520cd0bbc486bf1546d2c1be9337ed07ef201539ce74996f38eb239f07b/fastfeedparser-0.3.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-04-01 02:41:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kagisearch",
"github_project": "fastfeedparser",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "fastfeedparser"
}