...
+...
>>> entry = feedgen.add_entry()
>>> entry.title('First feed entry')
@@ -98,7 +99,7 @@ another name for add_entry(...)
-
-atom_file(filename, extensions=True, pretty=False, encoding='UTF-8')
+atom_file(filename, extensions=True, pretty=False, encoding='UTF-8', xml_declaration=True)
Generates an ATOM feed and write the resulting XML to a file.
@@ -108,6 +109,11 @@ another name for add_entry(...)
- filename – Name of file to write, or a file-like object, or a URL.
- extensions – Enable or disable the loaded extensions for the xml
generation (default: enabled).
+- pretty – If the feed should be split into multiple lines and
+properly indented.
+- encoding – Encoding used in the XML file (default: UTF-8).
+- xml_declaration – If an XML declaration should be added to the
+output (Default: enabled).
@@ -117,7 +123,7 @@ generation (default: enabled).
-
-atom_str(pretty=False, extensions=True, encoding='unicode')
+atom_str(pretty=False, extensions=True, encoding='UTF-8', xml_declaration=True)
Generates an ATOM feed and returns the feed XML as string.
@@ -128,6 +134,9 @@ generation (default: enabled).
properly indented.
- extensions – Enable or disable the loaded extensions for the xml
generation (default: enabled).
+- encoding – Encoding used in the XML file (default: UTF-8).
+- xml_declaration – If an XML declaration should be added to the
+output (Default: enabled).
@@ -136,6 +145,9 @@ generation (default: enabled).
+Return type: The return type may vary between different Python
+versions and your encoding parameters passed to this method. For details
+have a look at the lxml documentation
@@ -172,14 +184,14 @@ for RSS.
Example:
->>> feedgen.author( { 'name':'John Doe', 'email':'jdoe@example.com' } )
+>>> feedgen.author( { 'name':'John Doe', 'email':'jdoe@example.com' } )
[{'name':'John Doe','email':'jdoe@example.com'}]
->>> feedgen.author([{'name':'Mr. X'},{'name':'Max'}])
+>>> feedgen.author([{'name':'Mr. X'},{'name':'Max'}])
[{'name':'John Doe','email':'jdoe@example.com'},
{'name':'John Doe'}, {'name':'Max'}]
->>> feedgen.author( name='John Doe', email='jdoe@example.com', replace=True )
+>>> feedgen.author( name='John Doe', email='jdoe@example.com', replace=True )
[{'name':'John Doe','email':'jdoe@example.com'}]
@@ -493,10 +505,12 @@ include timezone information.
link(link=None, replace=False, **kwargs)
Get or set link data. An link element is a dict with the fields href,
rel, type, hreflang, title, and length. Href is mandatory for ATOM.
-This method can be called with:
-- the fields of a link as keyword arguments
-- the fields of a link as a dictionary
-- a list of dictionaries containing the link fields
+This method can be called with:
+
+- the fields of a link as keyword arguments
+- the fields of a link as a dictionary
+- a list of dictionaries containing the link fields
+
A link has the following fields: