A simple rss/atom feed parser
Project description
rssfeed
A simple rss/atom/opml parser
Installation
pip install rssfeed
Get Started
rss parse
import requests
import rssfeed
text = requests.get("https://lobste.rs/rss").text
rssfeed.parse(text)
{
"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": "<p><a href=\"https://lobste.rs/s/zm1g8r/why_i_m_writing_scheme_implementation\">Comments</a></p>"
},
{
"title": "14 years of systemd",
"author": "lwn.net via calvin",
"timestamp": 1739814564,
"url": "https://lwn.net/SubscriberLink/1008721/7c31808d76480012/",
"content": "<p><a href=\"https://lobste.rs/s/c6rk0l/14_years_systemd\">Comments</a></p>"
},
{
"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": "<p><a href=\"https://lobste.rs/s/sag0p3/making_web_more_readable_with_stylus\">Comments</a></p>"
}
]
}
rssfeed does not escape HTML tags, which means you had to sanitization content otherwise it may lead to Cross-site scripting attacks, a recommended choice is nh3.
opml parse
import rssfeed
opml = """
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>demo feeds</title>
</head>
<body>
<outline text="news">
<outline text="奇客Solidot" xmlUrl="https://www.solidot.org/index.rss" type="rss" />
<outline text="news-submenu">
<outline text="Lobsters" xmlUrl="https://lobste.rs/rss" type="rss" />
</outline>
</outline>
<outline text="阮一峰的网络日志" xmlUrl="https://feeds.feedburner.com/ruanyifeng" type="rss" />
</body>
</opml>
"""
rssfeed.opmlParse(opml)
{
"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"
}
]
}
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
rssfeed-0.4.3.tar.gz
(15.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
rssfeed-0.4.3-py3-none-any.whl
(16.0 kB
view details)
File details
Details for the file rssfeed-0.4.3.tar.gz.
File metadata
- Download URL: rssfeed-0.4.3.tar.gz
- Upload date:
- Size: 15.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d89bd11855d0940863e47ae7516a6a38566c02161c43e949a335265b32490804
|
|
| MD5 |
60d1a492ce48527124281a121b5185f4
|
|
| BLAKE2b-256 |
93257e429e07a79bbea467a74beb346911c88670e85dbf7712919a6958eb19d4
|
File details
Details for the file rssfeed-0.4.3-py3-none-any.whl.
File metadata
- Download URL: rssfeed-0.4.3-py3-none-any.whl
- Upload date:
- Size: 16.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f82354cd91c60011505b72b3a7b2eed852f1d558ee2569eafebd0814ea6793d9
|
|
| MD5 |
27064725afb3aa2e13616c98f1ce1886
|
|
| BLAKE2b-256 |
964cb0746178342bd7785ab5ff45bba65066011be83aa967c7899cb5137b539a
|