libearth.parser.rss1 — RSS 1.0 parser

Parsing RSS 1.0 feed.

libearth.parser.rss1.DC_NAMESPACE = 'http://purl.org/dc/elements/1.1/'

(str) The XML namespace for the predefined dc: prefix.

libearth.parser.rss1.RSS1_XMLNS = 'http://purl.org/rss/1.0/'

(str) The XML namespace used in RSS1 feed.

libearth.parser.rss1.parse_rss1(xml, feed_url=None, parse_entry=True)

Parse RSS 1.0 XML and translate it into Atom.

if dc:identifier is not present in channel or item elements, the uri in the link element would become the id of them.

dc:date can be used as updated element in Atom, but if not present, it uses other elements’ dc:date or parsing time is used to fill the updated element.

Parameters:
  • xml (str) – rss 1.0 xml string to parse
  • parse_item (bool) – whether to parse items (entries) as well. it’s useful when to ignore items when retrieve <source>. True by default
Returns:

a pair of (Feed, None)

Return type:

tuple

New in version 0.4.0.