https://github.com/p7e4/rssfeed
A simple rss/atom/opml parser
https://github.com/p7e4/rssfeed
feed rss rss-feed rss-feed-parser rss-parser
Last synced: 13 days ago
JSON representation
A simple rss/atom/opml parser
- Host: GitHub
- URL: https://github.com/p7e4/rssfeed
- Owner: p7e4
- License: gpl-3.0
- Created: 2024-06-02T03:28:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-10-06T04:38:58.000Z (5 months ago)
- Last Synced: 2025-10-06T05:40:45.719Z (5 months ago)
- Topics: feed, rss, rss-feed, rss-feed-parser, rss-parser
- Language: Python
- Homepage:
- Size: 37.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rssfeed
A simple rss/atom/opml parser
## Installation
`pip install rssfeed`
## Get Started
### rss parse
``` python
import requests
import rssfeed
text = requests.get("https://lobste.rs/rss").text
rssfeed.parse(text)
```
``` json
{
"name": "Lobsters",
"lastupdate": 1739824193,
"items": [
{
"title": "Why I'm Writing a Scheme Implementation in 2025 (The Answer is Async Rust)",
"author": "maplant.com by mplant",
"timestamp": 1739824193,
"url": "https://maplant.com/2025-02-17-Why-I'm-Writing-a-Scheme-Implementation-in-2025-(The-Answer-is-Async-Rust).html",
"content": "
"
},
{
"title": "14 years of systemd",
"author": "lwn.net via calvin",
"timestamp": 1739814564,
"url": "https://lwn.net/SubscriberLink/1008721/7c31808d76480012/",
"content": ""
},
{
"title": "Making the Web More Readable With Stylus",
"author": "wezm.net by wezm",
"timestamp": 1739757928,
"url": "https://www.wezm.net/v2/posts/2025/stylus/",
"content": ""
}
]
}
```
> rssfeed **does not** escape HTML tags, which means you had to sanitization content otherwise it may lead to [Cross-site scripting](https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting) attacks, a recommended choice is [nh3](https://github.com/messense/nh3).
### opml parse
``` python
import rssfeed
opml = """
demo feeds
"""
rssfeed.opmlParse(opml)
````
``` json
{
"default": [
{
"name": "阮一峰的网络日志",
"url": "https://feeds.feedburner.com/ruanyifeng"
}
],
"news": [
{
"name": "奇客Solidot",
"url": "https://www.solidot.org/index.rss"
},
{
"name": "Lobsters",
"url": "https://lobste.rs/rss"
}
]
}
```