share
Stack OverflowRecommended Python RSS/Atom feed generator?
[+47] [6] lupefiasco
[2008-09-11 17:17:31]
[ python rss atom generator ]
[ http://stackoverflow.com/questions/57117/recommended-python-rss-atom-feed-generator ] [DELETED]

Can you recommend a feed generator library for Python? I could build the XML myself, but I'm looking for a recommended library that is built from the ground up around the RSS (or Atom) spec.

Please make sure you make this feed PubSubHubbub! - Julien Genestoux
[+28] [2008-09-11 17:48:14] Ricardo Reyes [ACCEPTED]

I can recommend that you use PyRSS2Gen [1]. I've used it before and it's really simple and effective

[1] http://www.dalkescientific.com/Python/PyRSS2Gen.html

Thanks for the suggestion! - lupefiasco
1
[+9] [2008-09-11 17:25:14] Blair Conrad

I haven't used them myself, but these exist:

[1] http://www.dalkescientific.com/Python/PyRSS2Gen.html
[2] http://pypi.python.org/pypi/atomixlib/0.6.1a

2
[+4] [2009-05-14 23:53:00] Daryl Spitzer

According to http://trac.defuze.org/wiki & http://trac.defuze.org/wiki/atomixlib: atomxlib [1] is "deprecated in favor of the more generic bridge [2]".

So knowing that atomxlib is no longer updated, the choice (for me) is now between PyRSS2Gen [3] and a generic XML library [4] (but not necessarily bridge).

[1] http://trac.defuze.org/wiki/atomixlib
[2] http://trac.defuze.org/wiki/bridge
[3] http://www.dalkescientific.com/Python/PyRSS2Gen.html
[4] http://stackoverflow.com/questions/337/xml-processing-in-python

3
[+3] [2011-04-19 09:47:50] harobed

WebHelpers has a feedgenerator [1] class.

[1] http://sluggo.scrapping.cc/python/WebHelpers/modules/feedgenerator.html

4
[+2] [2010-09-26 19:50:41] Pascal Raszyk

You can use my dict2rss Library to create a RSS-Feed from JSON/DICT Hashes.

http://pastebucket.de/paste/749ce8de << Download this python-Modul and save it in your Python-Path. (Use dict2rss as Filename)

The Syntax is very easy. Justuse this bunch of code.


#!/usr/bin/python
import dict2rss

my_feed_data = {
    'title': 'My feed',

    'item':{
        'a': {
            'description':'Hello&World;',
            'content':'This is a sample Content',
            'comment': "This is a comment",
            'pubDate':'18 GMT 1202389 2010',
        },
        'b': {
            'description':'Second Item',
            'content':'I love dict2rss.py',
        },
    },

    'version':'0.1',
}

d = dict2rss(my_feed_data)
d.PrettyPrint()

You should now get the following Output in XML:


<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="0.1">
        <channel>
                <title>My feed</title>
                <link></link>
                <description>a mapped dict2rss</description>
                <language>en-en</language>  
            <item>
                        <content>This is a sample Content</content>
                        <!-- This is a comment -->
                        <description>Hello&World</description>
                        <pubDate>18 GMT 1202389 2010</pubDate>
                </item>
                <item>
                        <content>I love dict2rss.py</content>
                        <description>Second Item</description>
                </item>
        </channel>
</rss>

Very, very cool! - Kenny Meyer
(1) Looks like your URL is dead. Is there somewhere else I can get it? - zekel
Looks like it's been picked up again and updated over at GitHub - Kurt McKee
5
[+1] [2012-04-13 09:43:13] Arnaud

Quite a late contribution but I'd personally recommend this http://pypi.python.org/pypi/feedgenerator


6