Feed Type and Version Detection
Universal Feed Parser attempts to autodetect the type and version of the feeds it parses. There are many subtle and not-so-subtle differences between the different versions of RSS, and applications may choose to handle different feed types in different ways.
Accessing feed version
>>> d = feedparser.parse('https://feedparser.readthedocs.io/en/latest/examples/atom10.xml')
>>> d.version
'atom10'
>>> d = feedparser.parse('https://feedparser.readthedocs.io/en/latest/examples/atom03.xml')
>>> d.version
'atom03'
>>> d = feedparser.parse('https://feedparser.readthedocs.io/en/latest/examples/rss20.xml')
>>> d.version
'rss20'
>>> d = feedparser.parse('https://feedparser.readthedocs.io/en/latest/examples/rss20dc.xml')
>>> d.version
'rss20'
>>> d = feedparser.parse('https://feedparser.readthedocs.io/en/latest/examples/rss10.rdf')
>>> d.version
'rss10'
Here is the complete list of known feed types and versions that may be returned in version:
rss090rss091nrss091urss10rss092rss093rss094RSS 0.94 (no accurate specification is known to exist)
rss20rssRSS (unknown or unrecognized version)
atom01atom02atom03atom10atomAtom (unknown or unrecognized version)
cdfjson1JSONFeed v1. In cases where no MIME type is available, JSON is assumed if the first non-whitespace character of the data is an opening brace
{.json11
If the feed type is completely unknown, version will be an empty string.