Utilities to read and write RSS and Atom feeds.
Project description
feedendum
A python library to parse and generate RSS or atom feeds.
Features
This module can:
- parse RSS text and file
- parse Atom text and file
- read an url if
requests
is installed - access standard fields via
feed
class andfeed.item
list - access non-standard fields via
_data
dict - create arbitrary feed
- modify an existing feed
- generate a RSS text
- generate an Atom text
- preserve all data parsed, even in custom fields, when generating a RSS/Atom text
Usage
Parsing a file
For RSS:
feed = feedendum.from_rss_file(file_path)
feed = feedendum.from_rss_text(txt)
For Atom:
feed = feedendum.from_atom_file(file_path)
feed = feedendum.from_atom_text(txt)
Accessing to parsed data
Standard fields:
print("Title", feed.title)
print("First entry title", feed.items[0].title)
For other fields, not defined in Feed
class:
print("Extra attributes in the feed", feed._data)
print("Extra attributes in the first entry", feed.items[0]._data)
Writing a file
For RSS:
feedendum.to_rss_string(feed)
For Atom:
feedendum.to_atom_string(feed)
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
feedendum-0.1.0.tar.gz
(6.3 kB
view hashes)
Built Distribution
feedendum-0.1.0-py3-none-any.whl
(19.7 kB
view hashes)
Close
Hashes for feedendum-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 065dcd891bc1044dbb938d51a27cf2e7bdc436fe62842cfe02553ef8bcf0388c |
|
MD5 | f9eb15200c338ea79630c34eaa68c124 |
|
BLAKE2b-256 | 202cb852aefdbf5550824545a2519c554d53d1cc139f7ca0d4f4064cf55d33e7 |