A 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 and generate RSS feeds
- parse and generate RDF (RSS v1.0) feeds (thanks to @inigoserna)
- parse and generate Atom feeds
- access standard fields via
feed
class andfeed.item
list - preserve all data parsed, even in custom fields, when generating a RSS/Atom/RDF text
- read an url if
requests
is installed - access non-standard fields via
_data
dict - create arbitrary feed
- modify an existing feed
Usage
Parsing a file
For RSS:
feed = feedendum.from_rss_file(file_path)
feed = feedendum.from_rss_text(txt)
For RDF (RSS v1.0):
feed = feedendum.from_rdf_file(file_path)
feed = feedendum.from_rdf_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 RDF (RSS v1.0):
feedendum.to_rdf_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.3.1.tar.gz
(69.6 kB
view hashes)
Built Distribution
feedendum-0.3.1-py3-none-any.whl
(34.4 kB
view hashes)
Close
Hashes for feedendum-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d54d0aef2f574c8f7310b3d4019fbd6e51c29ba2e61ec59a372e074cdb622c59 |
|
MD5 | f7a5ebee58a3cd4056c5e95cd604e41a |
|
BLAKE2b-256 | 181ca71060277f5d76331d40ddebfa69cd002c28637c6a55a345749e256adcfd |