2013-05-05 22:12:47 +02:00
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" >
< head >
< meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" / >
2017-10-14 21:48:00 +02:00
< title > Feedgenerator — python-feedgen 0.6.1 documentation< / title >
2013-05-05 22:12:47 +02:00
< link rel = "stylesheet" href = "_static/lernfunk.css" type = "text/css" / >
< link rel = "stylesheet" href = "_static/pygments.css" type = "text/css" / >
< script type = "text/javascript" >
var DOCUMENTATION_OPTIONS = {
2015-01-21 01:09:16 +01:00
URL_ROOT: './',
2017-10-14 21:48:00 +02:00
VERSION: '0.6.1',
2013-05-05 22:12:47 +02:00
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
2017-10-14 21:48:00 +02:00
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
2013-05-05 22:12:47 +02:00
};
< / script >
< script type = "text/javascript" src = "_static/jquery.js" > < / script >
< script type = "text/javascript" src = "_static/underscore.js" > < / script >
< script type = "text/javascript" src = "_static/doctools.js" > < / script >
2017-01-05 01:58:23 +01:00
< link rel = "index" title = "Index" href = "genindex.html" / >
< link rel = "search" title = "Search" href = "search.html" / >
2013-05-05 22:12:47 +02:00
< link rel = "next" title = "API Documentation" href = "api.html" / >
< / head >
2017-01-05 01:58:23 +01:00
< body role = "document" >
< div class = "header" role = "banner" > < h1 class = "heading" > < a href = "#" >
2017-10-14 21:48:00 +02:00
< span > python-feedgen 0.6.1 documentation< / span > < / a > < / h1 >
2013-05-05 22:12:47 +02:00
< h2 class = "heading" > < span > Feedgenerator< / span > < / h2 >
< / div >
2017-01-05 01:58:23 +01:00
< div class = "topnav" role = "navigation" aria-label = "top navigation" >
2013-05-05 22:12:47 +02:00
< p >
< a class = "uplink" href = "#" > Contents< / a >
    ::   
< a href = "api.html" > API Documentation< / a >     »
< / p >
< / div >
< div class = "content" >
< div class = "contents topic" id = "table-of-contents" >
< p class = "topic-title first" > Table of Contents< / p >
< ul class = "simple" >
2017-01-05 01:58:23 +01:00
< li > < a class = "reference internal" href = "#feedgenerator" id = "id1" > Feedgenerator< / a > < ul >
< li > < a class = "reference internal" href = "#installation" id = "id2" > Installation< / a > < / li >
< li > < a class = "reference internal" href = "#create-a-feed" id = "id3" > Create a Feed< / a > < / li >
< li > < a class = "reference internal" href = "#generate-the-feed" id = "id4" > Generate the Feed< / a > < / li >
< li > < a class = "reference internal" href = "#add-feed-entries" id = "id5" > Add Feed Entries< / a > < / li >
< li > < a class = "reference internal" href = "#extensions" id = "id6" > Extensions< / a > < / li >
< li > < a class = "reference internal" href = "#testing-the-generator" id = "id7" > Testing the Generator< / a > < / li >
2013-05-05 22:12:47 +02:00
< / ul >
< / li >
2017-01-05 01:58:23 +01:00
< li > < a class = "reference internal" href = "#module-documentation" id = "id8" > Module documentation< / a > < / li >
< li > < a class = "reference internal" href = "#indices-and-tables" id = "id9" > Indices and tables< / a > < / li >
2013-05-05 22:12:47 +02:00
< / ul >
< / div >
< div class = "section" id = "feedgenerator" >
2017-01-05 01:58:23 +01:00
< h1 > < a class = "toc-backref" href = "#id1" > Feedgenerator< / a > < a class = "headerlink" href = "#feedgenerator" title = "Permalink to this headline" > ¶< / a > < / h1 >
< a class = "reference external image-reference" href = "https://travis-ci.org/lkiesow/python-feedgen" > < img alt = "Build Status" src = "https://travis-ci.org/lkiesow/python-feedgen.svg?branch=master" / > < / a >
2017-10-14 21:48:00 +02:00
< a class = "reference external image-reference" href = "https://coveralls.io/github/lkiesow/python-feedgen?branch=master" > < img alt = "Test Coverage Status" src = "https://coveralls.io/repos/github/lkiesow/python-feedgen/badge.svg?branch=master" / > < / a >
2013-05-05 22:12:47 +02:00
< p > This module can be used to generate web feeds in both ATOM and RSS format. It
2017-01-05 01:58:23 +01:00
has support for extensions. Included is for example an extension to produce Podcasts.< / p >
2013-05-05 22:12:47 +02:00
< p > It is licensed under the terms of both, the FreeBSD license and the LGPLv3+.
Choose the one which is more convenient for you. For more details have a look
at license.bsd and license.lgpl.< / p >
2013-05-16 20:15:39 +02:00
< p > More details about the project:< / p >
< ul class = "simple" >
2013-05-16 21:44:06 +02:00
< li > Repository: < a class = "reference external" href = "https://github.com/lkiesow/python-feedgen" > https://github.com/lkiesow/python-feedgen< / a > < / li >
< li > Documentation: < a class = "reference external" href = "http://lkiesow.github.io/python-feedgen/" > http://lkiesow.github.io/python-feedgen/< / a > < / li >
< li > Python Package Index: < a class = "reference external" href = "https://pypi.python.org/pypi/feedgen/" > https://pypi.python.org/pypi/feedgen/< / a > < / li >
2013-05-16 20:15:39 +02:00
< / ul >
2013-05-05 22:12:47 +02:00
< div class = "section" id = "installation" >
2017-01-05 01:58:23 +01:00
< h2 > < a class = "toc-backref" href = "#id2" > Installation< / a > < a class = "headerlink" href = "#installation" title = "Permalink to this headline" > ¶< / a > < / h2 >
2013-05-05 22:12:47 +02:00
< p > < strong > Prebuild packages< / strong > < / p >
2016-09-04 21:54:21 +02:00
< p > If you are running Fedora Linux, RedHat Enterprise Linux, CentOS or Scientific
Linux you can use the RPM Copr repostiory:< / p >
2017-01-05 01:58:23 +01:00
< p > < a class = "reference external" href = "http://copr.fedoraproject.org/coprs/lkiesow/python-feedgen/" > http://copr.fedoraproject.org/coprs/lkiesow/python-feedgen/< / a > < / p >
2016-09-04 21:54:21 +02:00
< p > Simply enable the repository and run:< / p >
2017-01-05 01:58:23 +01:00
< div class = "highlight-default" > < div class = "highlight" > < pre > < span > < / span > $ yum install python-feedgen
< / pre > < / div >
< / div >
2016-09-04 21:54:21 +02:00
< p > or for the Python 3 package:< / p >
2017-01-05 01:58:23 +01:00
< div class = "highlight-default" > < div class = "highlight" > < pre > < span > < / span > $ yum install python3-feedgen
< / pre > < / div >
< / div >
2013-05-05 22:12:47 +02:00
< p > < strong > Using pip< / strong > < / p >
< p > You can also use pip to install the feedgen module. Simply run:< / p >
2017-01-05 01:58:23 +01:00
< div class = "highlight-default" > < div class = "highlight" > < pre > < span > < / span > $ pip install feedgen
2015-01-21 01:09:16 +01:00
< / pre > < / div >
2013-05-05 22:12:47 +02:00
< / div >
< / div >
< div class = "section" id = "create-a-feed" >
2017-01-05 01:58:23 +01:00
< h2 > < a class = "toc-backref" href = "#id3" > Create a Feed< / a > < a class = "headerlink" href = "#create-a-feed" title = "Permalink to this headline" > ¶< / a > < / h2 >
2013-05-05 22:12:47 +02:00
< p > To create a feed simply instanciate the FeedGenerator class and insert some
data:< / p >
2017-01-05 01:58:23 +01:00
< div class = "highlight-default" > < div class = "highlight" > < pre > < span > < / span > < span class = "gp" > > > > < / span > < span class = "kn" > from< / span > < span class = "nn" > feedgen.feed< / span > < span class = "k" > import< / span > < span class = "n" > FeedGenerator< / span >
2013-05-05 22:12:47 +02:00
< span class = "gp" > > > > < / span > < span class = "n" > fg< / span > < span class = "o" > =< / span > < span class = "n" > FeedGenerator< / span > < span class = "p" > ()< / span >
2016-09-04 21:54:21 +02:00
< span class = "gp" > > > > < / span > < span class = "n" > fg< / span > < span class = "o" > .< / span > < span class = "n" > id< / span > < span class = "p" > (< / span > < span class = "s1" > ' http://lernfunk.de/media/654321' < / span > < span class = "p" > )< / span >
< span class = "gp" > > > > < / span > < span class = "n" > fg< / span > < span class = "o" > .< / span > < span class = "n" > title< / span > < span class = "p" > (< / span > < span class = "s1" > ' Some Testfeed' < / span > < span class = "p" > )< / span >
< span class = "gp" > > > > < / span > < span class = "n" > fg< / span > < span class = "o" > .< / span > < span class = "n" > author< / span > < span class = "p" > (< / span > < span class = "p" > {< / span > < span class = "s1" > ' name' < / span > < span class = "p" > :< / span > < span class = "s1" > ' John Doe' < / span > < span class = "p" > ,< / span > < span class = "s1" > ' email' < / span > < span class = "p" > :< / span > < span class = "s1" > ' john@example.de' < / span > < span class = "p" > }< / span > < span class = "p" > )< / span >
< span class = "gp" > > > > < / span > < span class = "n" > fg< / span > < span class = "o" > .< / span > < span class = "n" > link< / span > < span class = "p" > (< / span > < span class = "n" > href< / span > < span class = "o" > =< / span > < span class = "s1" > ' http://example.com' < / span > < span class = "p" > ,< / span > < span class = "n" > rel< / span > < span class = "o" > =< / span > < span class = "s1" > ' alternate' < / span > < span class = "p" > )< / span >
< span class = "gp" > > > > < / span > < span class = "n" > fg< / span > < span class = "o" > .< / span > < span class = "n" > logo< / span > < span class = "p" > (< / span > < span class = "s1" > ' http://ex.com/logo.jpg' < / span > < span class = "p" > )< / span >
< span class = "gp" > > > > < / span > < span class = "n" > fg< / span > < span class = "o" > .< / span > < span class = "n" > subtitle< / span > < span class = "p" > (< / span > < span class = "s1" > ' This is a cool feed!' < / span > < span class = "p" > )< / span >
< span class = "gp" > > > > < / span > < span class = "n" > fg< / span > < span class = "o" > .< / span > < span class = "n" > link< / span > < span class = "p" > (< / span > < span class = "n" > href< / span > < span class = "o" > =< / span > < span class = "s1" > ' http://larskiesow.de/test.atom' < / span > < span class = "p" > ,< / span > < span class = "n" > rel< / span > < span class = "o" > =< / span > < span class = "s1" > ' self' < / span > < span class = "p" > )< / span >
< span class = "gp" > > > > < / span > < span class = "n" > fg< / span > < span class = "o" > .< / span > < span class = "n" > language< / span > < span class = "p" > (< / span > < span class = "s1" > ' en' < / span > < span class = "p" > )< / span >
2013-05-05 22:12:47 +02:00
< / pre > < / div >
< / div >
< p > Note that for the methods which set fields that can occur more than once in a
feed you can use all of the following ways to provide data:< / p >
< ul class = "simple" >
< li > Provide the data for that element as keyword arguments< / li >
< li > Provide the data for that element as dictionary< / li >
< li > Provide a list of dictionaries with the data for several elements< / li >
< / ul >
< p > Example:< / p >
2017-01-05 01:58:23 +01:00
< div class = "highlight-default" > < div class = "highlight" > < pre > < span > < / span > < span class = "gp" > > > > < / span > < span class = "n" > fg< / span > < span class = "o" > .< / span > < span class = "n" > contributor< / span > < span class = "p" > (< / span > < span class = "n" > name< / span > < span class = "o" > =< / span > < span class = "s1" > ' John Doe' < / span > < span class = "p" > ,< / span > < span class = "n" > email< / span > < span class = "o" > =< / span > < span class = "s1" > ' jdoe@example.com' < / span > < span class = "p" > )< / span >
2016-09-04 21:54:21 +02:00
< span class = "gp" > > > > < / span > < span class = "n" > fg< / span > < span class = "o" > .< / span > < span class = "n" > contributor< / span > < span class = "p" > ({< / span > < span class = "s1" > ' name' < / span > < span class = "p" > :< / span > < span class = "s1" > ' John Doe' < / span > < span class = "p" > ,< / span > < span class = "s1" > ' email' < / span > < span class = "p" > :< / span > < span class = "s1" > ' jdoe@example.com' < / span > < span class = "p" > })< / span >
< span class = "gp" > > > > < / span > < span class = "n" > fg< / span > < span class = "o" > .< / span > < span class = "n" > contributor< / span > < span class = "p" > ([{< / span > < span class = "s1" > ' name' < / span > < span class = "p" > :< / span > < span class = "s1" > ' John Doe' < / span > < span class = "p" > ,< / span > < span class = "s1" > ' email' < / span > < span class = "p" > :< / span > < span class = "s1" > ' jdoe@example.com' < / span > < span class = "p" > },< / span > < span class = "o" > ...< / span > < span class = "p" > ])< / span >
2013-05-05 22:12:47 +02:00
< / pre > < / div >
< / div >
< / div >
< div class = "section" id = "generate-the-feed" >
2017-01-05 01:58:23 +01:00
< h2 > < a class = "toc-backref" href = "#id4" > Generate the Feed< / a > < a class = "headerlink" href = "#generate-the-feed" title = "Permalink to this headline" > ¶< / a > < / h2 >
2013-05-05 22:12:47 +02:00
< p > After that you can generate both RSS or ATOM by calling the respective method:< / p >
2017-01-05 01:58:23 +01:00
< div class = "highlight-default" > < div class = "highlight" > < pre > < span > < / span > < span class = "gp" > > > > < / span > < span class = "n" > atomfeed< / span > < span class = "o" > =< / span > < span class = "n" > fg< / span > < span class = "o" > .< / span > < span class = "n" > atom_str< / span > < span class = "p" > (< / span > < span class = "n" > pretty< / span > < span class = "o" > =< / span > < span class = "kc" > True< / span > < span class = "p" > )< / span > < span class = "c1" > # Get the ATOM feed as string< / span >
< span class = "gp" > > > > < / span > < span class = "n" > rssfeed< / span > < span class = "o" > =< / span > < span class = "n" > fg< / span > < span class = "o" > .< / span > < span class = "n" > rss_str< / span > < span class = "p" > (< / span > < span class = "n" > pretty< / span > < span class = "o" > =< / span > < span class = "kc" > True< / span > < span class = "p" > )< / span > < span class = "c1" > # Get the RSS feed as string< / span >
2016-09-04 21:54:21 +02:00
< span class = "gp" > > > > < / span > < span class = "n" > fg< / span > < span class = "o" > .< / span > < span class = "n" > atom_file< / span > < span class = "p" > (< / span > < span class = "s1" > ' atom.xml' < / span > < span class = "p" > )< / span > < span class = "c1" > # Write the ATOM feed to a file< / span >
< span class = "gp" > > > > < / span > < span class = "n" > fg< / span > < span class = "o" > .< / span > < span class = "n" > rss_file< / span > < span class = "p" > (< / span > < span class = "s1" > ' rss.xml' < / span > < span class = "p" > )< / span > < span class = "c1" > # Write the RSS feed to a file< / span >
2013-05-05 22:12:47 +02:00
< / pre > < / div >
< / div >
< / div >
< div class = "section" id = "add-feed-entries" >
2017-01-05 01:58:23 +01:00
< h2 > < a class = "toc-backref" href = "#id5" > Add Feed Entries< / a > < a class = "headerlink" href = "#add-feed-entries" title = "Permalink to this headline" > ¶< / a > < / h2 >
2013-05-05 22:12:47 +02:00
< p > To add entries (items) to a feed you need to create new FeedEntry objects and
append them to the list of entries in the FeedGenerator. The most convenient
way to go is to use the FeedGenerator itself for the instantiation of the
FeedEntry object:< / p >
2017-01-05 01:58:23 +01:00
< div class = "highlight-default" > < div class = "highlight" > < pre > < span > < / span > < span class = "gp" > > > > < / span > < span class = "n" > fe< / span > < span class = "o" > =< / span > < span class = "n" > fg< / span > < span class = "o" > .< / span > < span class = "n" > add_entry< / span > < span class = "p" > ()< / span >
2016-09-04 21:54:21 +02:00
< span class = "gp" > > > > < / span > < span class = "n" > fe< / span > < span class = "o" > .< / span > < span class = "n" > id< / span > < span class = "p" > (< / span > < span class = "s1" > ' http://lernfunk.de/media/654321/1' < / span > < span class = "p" > )< / span >
< span class = "gp" > > > > < / span > < span class = "n" > fe< / span > < span class = "o" > .< / span > < span class = "n" > title< / span > < span class = "p" > (< / span > < span class = "s1" > ' The First Episode' < / span > < span class = "p" > )< / span >
2017-10-14 21:48:00 +02:00
< span class = "gp" > > > > < / span > < span class = "n" > fe< / span > < span class = "o" > .< / span > < span class = "n" > link< / span > < span class = "p" > (< / span > < span class = "n" > href< / span > < span class = "o" > =< / span > < span class = "s2" > " http://lernfunk.de/feed" < / span > < span class = "p" > )< / span >
2013-05-05 22:12:47 +02:00
< / pre > < / div >
< / div >
2016-09-04 21:54:21 +02:00
< p > The FeedGenerators method < cite > add_entry(...)< / cite > without argument provides will
2013-05-05 22:12:47 +02:00
automatically generate a new FeedEntry object, append it to the feeds internal
list of entries and return it, so that additional data can be added.< / p >
< / div >
< div class = "section" id = "extensions" >
2017-01-05 01:58:23 +01:00
< h2 > < a class = "toc-backref" href = "#id6" > Extensions< / a > < a class = "headerlink" href = "#extensions" title = "Permalink to this headline" > ¶< / a > < / h2 >
2013-05-05 22:12:47 +02:00
< p > The FeedGenerator supports extension to include additional data into the XML
structure of the feeds. Extensions can be loaded like this:< / p >
2017-01-05 01:58:23 +01:00
< div class = "highlight-default" > < div class = "highlight" > < pre > < span > < / span > < span class = "gp" > > > > < / span > < span class = "n" > fg< / span > < span class = "o" > .< / span > < span class = "n" > load_extension< / span > < span class = "p" > (< / span > < span class = "s1" > ' someext' < / span > < span class = "p" > ,< / span > < span class = "n" > atom< / span > < span class = "o" > =< / span > < span class = "kc" > True< / span > < span class = "p" > ,< / span > < span class = "n" > rss< / span > < span class = "o" > =< / span > < span class = "kc" > True< / span > < span class = "p" > )< / span >
2013-05-05 22:12:47 +02:00
< / pre > < / div >
< / div >
< p > This will try to load the extension “someext” from the file < cite > ext/someext.py< / cite > .
It is required that < cite > someext.py< / cite > contains a class named “SomextExtension” which
is required to have at least the two methods < cite > extend_rss(...)< / cite > and
< cite > extend_atom(...)< / cite > . Although not required, it is strongly suggested to use
< cite > BaseExtension< / cite > from < cite > ext/base.py< / cite > as superclass.< / p >
< p > < cite > load_extension(‘ someext’ , ...)< / cite > will also try to load a class named
“SomextEntryExtension” for every entry of the feed. This class can be located
either in the same file as SomextExtension or in < cite > ext/someext_entry.py< / cite > which
is suggested especially for large extensions.< / p >
2016-09-04 21:54:21 +02:00
< p > The parameters < cite > atom< / cite > and < cite > rss< / cite > control if the extension is used for ATOM and
RSS feeds, respectively. The default value for both parameters is < cite > true< / cite >
meaning the extension is used for both kinds of feeds.< / p >
< p > < strong > Example: Producing a Podcast< / strong > < / p >
2013-05-05 22:12:47 +02:00
< p > One extension already provided is the podcast extension. A podcast is an RSS
feed with some additional elements for ITunes.< / p >
< p > To produce a podcast simply load the < cite > podcast< / cite > extension:< / p >
2017-01-05 01:58:23 +01:00
< div class = "highlight-default" > < div class = "highlight" > < pre > < span > < / span > < span class = "gp" > > > > < / span > < span class = "kn" > from< / span > < span class = "nn" > feedgen.feed< / span > < span class = "k" > import< / span > < span class = "n" > FeedGenerator< / span >
2013-05-05 22:12:47 +02:00
< span class = "gp" > > > > < / span > < span class = "n" > fg< / span > < span class = "o" > =< / span > < span class = "n" > FeedGenerator< / span > < span class = "p" > ()< / span >
2016-09-04 21:54:21 +02:00
< span class = "gp" > > > > < / span > < span class = "n" > fg< / span > < span class = "o" > .< / span > < span class = "n" > load_extension< / span > < span class = "p" > (< / span > < span class = "s1" > ' podcast' < / span > < span class = "p" > )< / span >
2013-05-05 22:12:47 +02:00
< span class = "gp" > ...< / span >
2016-09-04 21:54:21 +02:00
< span class = "gp" > > > > < / span > < span class = "n" > fg< / span > < span class = "o" > .< / span > < span class = "n" > podcast< / span > < span class = "o" > .< / span > < span class = "n" > itunes_category< / span > < span class = "p" > (< / span > < span class = "s1" > ' Technology' < / span > < span class = "p" > ,< / span > < span class = "s1" > ' Podcasting' < / span > < span class = "p" > )< / span >
2013-05-05 22:12:47 +02:00
< span class = "gp" > ...< / span >
2015-01-21 01:09:16 +01:00
< span class = "gp" > > > > < / span > < span class = "n" > fe< / span > < span class = "o" > =< / span > < span class = "n" > fg< / span > < span class = "o" > .< / span > < span class = "n" > add_entry< / span > < span class = "p" > ()< / span >
2016-09-04 21:54:21 +02:00
< span class = "gp" > > > > < / span > < span class = "n" > fe< / span > < span class = "o" > .< / span > < span class = "n" > id< / span > < span class = "p" > (< / span > < span class = "s1" > ' http://lernfunk.de/media/654321/1/file.mp3' < / span > < span class = "p" > )< / span >
< span class = "gp" > > > > < / span > < span class = "n" > fe< / span > < span class = "o" > .< / span > < span class = "n" > title< / span > < span class = "p" > (< / span > < span class = "s1" > ' The First Episode' < / span > < span class = "p" > )< / span >
< span class = "gp" > > > > < / span > < span class = "n" > fe< / span > < span class = "o" > .< / span > < span class = "n" > description< / span > < span class = "p" > (< / span > < span class = "s1" > ' Enjoy our first episode.' < / span > < span class = "p" > )< / span >
< span class = "gp" > > > > < / span > < span class = "n" > fe< / span > < span class = "o" > .< / span > < span class = "n" > enclosure< / span > < span class = "p" > (< / span > < span class = "s1" > ' http://lernfunk.de/media/654321/1/file.mp3' < / span > < span class = "p" > ,< / span > < span class = "mi" > 0< / span > < span class = "p" > ,< / span > < span class = "s1" > ' audio/mpeg' < / span > < span class = "p" > )< / span >
2015-01-21 01:09:16 +01:00
< span class = "gp" > ...< / span >
2017-01-05 01:58:23 +01:00
< span class = "gp" > > > > < / span > < span class = "n" > fg< / span > < span class = "o" > .< / span > < span class = "n" > rss_str< / span > < span class = "p" > (< / span > < span class = "n" > pretty< / span > < span class = "o" > =< / span > < span class = "kc" > True< / span > < span class = "p" > )< / span >
2016-09-04 21:54:21 +02:00
< span class = "gp" > > > > < / span > < span class = "n" > fg< / span > < span class = "o" > .< / span > < span class = "n" > rss_file< / span > < span class = "p" > (< / span > < span class = "s1" > ' podcast.xml' < / span > < span class = "p" > )< / span >
2013-05-05 22:12:47 +02:00
< / pre > < / div >
< / div >
< p > Of cause the extension has to be loaded for the FeedEntry objects as well but
this is done automatically by the FeedGenerator for every feed entry if the
extension is loaded for the whole feed. You can, however, load an extension for
a specific FeedEntry by calling < cite > load_extension(...)< / cite > on that entry. But this
is a rather uncommon use.< / p >
2016-09-04 21:54:21 +02:00
< p > You can still produce a normal ATOM or RSS feed, even if you have loaded some
plugins by temporary disabling them during the feed generation. This can be
done by calling the generating method with the keyword argument < cite > extensions< / cite >
set to < cite > False< / cite > .< / p >
< p > < strong > Custom Extensions< / strong > < / p >
< p > If you want to load custom extension which are not part of the feedgen Python
package, you can use the method < cite > register_extension< / cite > instead. You can directly
pass the classes for the feed and the entry extension to this method meaning
that you can define them everywhere.< / p >
2013-05-05 22:12:47 +02:00
< / div >
< div class = "section" id = "testing-the-generator" >
2017-01-05 01:58:23 +01:00
< h2 > < a class = "toc-backref" href = "#id7" > Testing the Generator< / a > < a class = "headerlink" href = "#testing-the-generator" title = "Permalink to this headline" > ¶< / a > < / h2 >
2013-05-05 22:12:47 +02:00
< p > You can test the module by simply executing:< / p >
2017-01-05 01:58:23 +01:00
< div class = "highlight-default" > < div class = "highlight" > < pre > < span > < / span > $ python -m feedgen
2015-01-21 01:09:16 +01:00
< / pre > < / div >
2013-05-05 22:12:47 +02:00
< / div >
< p > If you want to have a look at the code for this test to have a working code
example for a whole feed generation process, you can find it in the
< a class = "reference external" href = "https://github.com/lkiesow/python-feedgen/blob/master/feedgen/__main__.py" > __main__.py< / a > .< / p >
< hr / > < / div >
< / div >
< div class = "section" id = "module-documentation" >
2017-01-05 01:58:23 +01:00
< h1 > < a class = "toc-backref" href = "#id8" > Module documentation< / a > < a class = "headerlink" href = "#module-documentation" title = "Permalink to this headline" > ¶< / a > < / h1 >
2013-05-05 22:12:47 +02:00
< div class = "toctree-wrapper compound" >
< ul >
< li class = "toctree-l1" > < a class = "reference internal" href = "api.html" > API Documentation< / a > < ul >
< li class = "toctree-l2" > < a class = "reference internal" href = "api.html#feedgen" > feedgen< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "api.feed.html" > feedgen.feed< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "api.entry.html" > feedgen.entry< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "api.util.html" > feedgen.util< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "ext/api.ext.base.html" > feedgen.ext.base< / a > < / li >
2014-07-21 00:38:21 +02:00
< li class = "toctree-l2" > < a class = "reference internal" href = "ext/api.ext.dc.html" > feedgen.ext.dc< / a > < / li >
2013-05-05 22:12:47 +02:00
< li class = "toctree-l2" > < a class = "reference internal" href = "ext/api.ext.podcast.html" > feedgen.ext.podcast< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "ext/api.ext.podcast_entry.html" > feedgen.ext.podcast_entry< / a > < / li >
2016-09-04 21:54:21 +02:00
< li class = "toctree-l2" > < a class = "reference internal" href = "ext/api.ext.torrent.html" > feedgen.ext.torrent< / a > < / li >
2013-05-05 22:12:47 +02:00
< / ul >
< / li >
< / ul >
< / div >
< / div >
< div class = "section" id = "indices-and-tables" >
2017-01-05 01:58:23 +01:00
< h1 > < a class = "toc-backref" href = "#id9" > Indices and tables< / a > < a class = "headerlink" href = "#indices-and-tables" title = "Permalink to this headline" > ¶< / a > < / h1 >
2013-05-05 22:12:47 +02:00
< ul class = "simple" >
2017-01-05 01:58:23 +01:00
< li > < a class = "reference internal" href = "genindex.html" > < span class = "std std-ref" > Index< / span > < / a > < / li >
< li > < a class = "reference internal" href = "py-modindex.html" > < span class = "std std-ref" > Module Index< / span > < / a > < / li >
< li > < a class = "reference internal" href = "search.html" > < span class = "std std-ref" > Search Page< / span > < / a > < / li >
2013-05-05 22:12:47 +02:00
< / ul >
< / div >
< / div >
2017-01-05 01:58:23 +01:00
< div class = "bottomnav" role = "navigation" aria-label = "bottom navigation" >
2013-05-05 22:12:47 +02:00
< p >
< a class = "uplink" href = "#" > Contents< / a >
    ::   
< a href = "api.html" > API Documentation< / a >     »
< / p >
< / div >
2017-01-05 01:58:23 +01:00
< div class = "footer" role = "contentinfo" >
© Copyright 2013-2016, Lars Kiesow.
2017-10-14 21:48:00 +02:00
Created using < a href = "http://sphinx-doc.org/" > Sphinx< / a > 1.5.2.
2013-05-05 22:12:47 +02:00
< / div >
< / body >
< / html >