创建苹果报摊atom提要
atomgen的Python项目详细描述
##atomgen v 0.1.9
==
创建与atom feed的v1.2兼容的apple报摊atom feed
它还可以基于atomfeed规范验证远程或本地图像
请注意,这不同于普通atom feed:[规范](https://itunesconnect.apple.com/docs/newstandatomfeedspecification.pdf)
sage
>;>import datetime
>;>from atomgen import atomgen
simple
>;>a=[{id':'1','updated':datetime.datetime(2013,12,10,1,9,53,977342),
…。发布日期:datetime.datetime(2013、12、10、1、10、53、977342),
…摘要":"这是摘要1","图标":"http://ccc.com/img.png"},
…{'id':2,'updated':datetime.datetime(2013,12,9,1,9,53,977342),
…发布日期:datetime.datetime(2013、12、10、1、7、53、977342),
…摘要":"这是摘要2","图标":"http://ccc2.com/img2.png"}"
>;>;my_atom=atomgen()
>;>;打印my_atom.run(a,update_time=datetime.datetime(2013,12,10,1,9,53,977342))
<;?XML版本='1.0'编码='utf-8'?>;
<;feed xmlns="http://www.w3.org/2005/atom"xmlns:news="http://itunes.apple.com/2011/报摊">;<;updated>;2013-12-10t01:09:53z<;/updated>;<;entry>;<;id>;1<;/id>;<;updated>;2013-12-10t01:09:53z<;/updated>;<;published>;2013-12-10t01:10:53z<;/发布lished>;<;summary>;这是摘要1<;/summary>;<;新闻:封面艺术图标>;<;新闻:封面艺术图标size="source" src="http://ccc.com/img.png"/>;<;/news:封面艺术图标>;<;/entry>;<;entry>;<;id>;2<;/id>;<;更新>;2013-12-09t01:09:53z<;/updated>;<;发布ished>;2013-12-10t01:07:53z<;/已发布>;<;摘要>;这是摘要2<;/摘要>;<;新闻:封面艺术图标>;<;新闻:封面艺术图标size="source" src="http://ccc2.com/img2.png"/>;<;/新闻:封面艺术图标>;<;/entry>;<;/feed>;
原始字典。您需要让atomgen知道与默认名称的对应关系。
>;>;b=[{'my_id':'1','when_updated':datetime.datetime(2013,12,10,1,9,53,977342),
…'发布时间:datetime.datetime(2013、12、10、1、10、53、977342),
…"总结":"这是总结1","我的图标":"http://ccc.com/img.png"},
…{我的'u id':2,'更新时':datetime.datetime(2013,12,9,1,9,53,977342),
…'发布时间:datetime.datetime(2013、12、10、1、7、53、977342),
…"摘要":"这是摘要2","MyIcon":"http://ccc2.com/img2.png"}]
>;>my_atom2=atomgen(id="my_id",published="when_published",updated="when_updated",
…summary="The_summary",icon="myicon")
>;>gt;打印my_atom2.run(b,update_time=datetime.datetime(2013,12,10,1,9,53,977342))
<;?XML版本='1.0'编码='utf-8'?>;
<;feed xmlns="http://www.w3.org/2005/atom"xmlns:news="http://itunes.apple.com/2011/报摊">;<;updated>;2013-12-10t01:09:53z<;/updated>;<;entry>;<;id>;1<;/id>;<;updated>;2013-12-10t01:09:53z<;/updated>;<;published>;2013-12-10t01:10:53z<;/发布lished>;<;summary>;这是摘要1<;/summary>;<;新闻:封面艺术图标>;<;新闻:封面艺术图标size="source" src="http://ccc.com/img.png"/>;<;/news:封面艺术图标>;<;/entry>;<;entry>;<;id>;2<;/id>;<;更新>;2013-12-09t01:09:53z<;/updated>;<;发布ished>;2013-12-10t01:07:53z<;/已发布>;<;摘要>;这是摘要2<;/摘要>;<;新闻:封面图标>;<;新闻:封面on size="source" src="http://ccc2.com/img2.png"/>;<;/新闻:封面艺术图标>;<;/entry>;<;/feed>;
发布日期:datetime.datetime(2013、12、10、1、10、53、977342),
…摘要":"这是摘要1","图标":"http://ccc.com/img.png"},
…2:{'updated':日期时间.日期时间(2013,12,9,1,9,53,977342),
…发布日期:datetime.datetime(2013、12、10、1、7、53、977342),
…摘要":"这是摘要2","图标":"http://ccc2.com/img2.png"},}
>>gt;打印我的原子。运行(c,update_time=datetime.datetime(2013,12,10,1,9,53,977342))
<;?XML版本='1.0'编码='utf-8'?>;
<;feed xmlns="http://www.w3.org/2005/atom"xmlns:news="http://itunes.apple.com/2011/报摊">;<;updated>;2013-12-10t01:09:53z<;/updated>;<;entry>;<;id>;1<;/id>;<;updated>;2013-12-10t01:09:53z<;/updated>;<;published>;2013-12-10t01:10:53z<;/发布lished>;<;summary>;这是摘要1<;/summary>;<;新闻:封面艺术图标>;<;新闻:封面艺术图标size="source" src="http://ccc.com/img.png"/>;<;/news:封面艺术图标>;<;/entry>;<;entry>;<;id>;2<;/id>;<;更新>;2013-12-09t01:09:53z<;/updated>;<;发布ished>;2013-12-10t01:07:53z<;/已发布>;<;摘要>;这是摘要2<;/摘要>;<;新闻:封面艺术图标>;<;新闻:封面艺术图标size="source" src="http://ccc2.com/img2.png"/>;<;/news:封面艺术图标>;<;/entry>;<;/feed>;
s用于输入自定义名称
>;>;d={'1':{'更新时':datetime.datetime(2013,12,10,1,9,53,977342),
…'发布时间:datetime.datetime(2013、12、10、1、10、53、977342),
…"总结":"这是总结1","我的图标":"http://ccc.com/img.png"},
…2:{"更新时":datetime.datetime(2013、12、9、1、9、53、977342),
…。发布时间:datetime.datetime(2013、12、10、1、7、53、977342),
…"摘要":"这是摘要2","myicon":"http://ccc2.com/img2.png"},}
>;>my_atom2=atomgen(id="my_id",published="when_published",updated="when_updated",
…summary="The_summary",icon="myicon")
>>gt;打印my_atom2.run(d,update_time=datetime.datetime(2013,12,10,1,9,53,977342))
<;?XML版本='1.0'编码='utf-8'?>;
<;feed xmlns="http://www.w3.org/2005/atom"xmlns:news="http://itunes.apple.com/2011/报摊">;<;updated>;2013-12-10t01:09:53z<;/updated>;<;entry>;<;id>;1<;/id>;<;updated>;2013-12-10t01:09:53z<;/updated>;<;published>;2013-12-10t01:10:53z<;/发布lished>;<;summary>;这是摘要1<;/summary>;<;新闻:封面艺术图标>;<;新闻:封面艺术图标size="source" src="http://ccc.com/img.png"/>;<;/news:封面艺术图标>;<;/entry>;<;entry>;<;id>;2<;/id>;<;更新>;2013-12-09t01:09:53z<;/updated>;<;发布ished>;2013-12-10t01:07:53z<;/已发布>;<;摘要>;这是摘要2<;/summary>;<;新闻:封面艺术图标>;<;新闻:封面艺术图标size="source" src="http://ccc2.com/img2.png"/>;<;/news:封面艺术图标>;<;/entry>;<;/feed>;
同样的原子馈送。但它可以让您灵活地使用喜欢的名称修改自己的字典键。
发布时间:datetime.datetime(2013、12、10、1、10、53、977342),
…"总结":"这是总结1","我的图标":"http://cdn.tensing.com/uploads/magazine/test_material/img_1024_600.png"},
…2:{"更新时":datetime.datetime(2013、12、9、1、9、53、977342),
…发布时间:datetime.datetime(2013、12、10、1、7、53、977342),
…"总结":"这是总结2","我的图标":"http://cdn.tensing.com/uploads/magazine/test_material/img_1024_600.png"},}
>;;my_Atom2=atomgen(id="my_ID",published="when_Published",updated="when_Updated",
…summary="The_summary",icon="myicon")
>>gt;打印(my_atom2.run(d,update_time=datetime.datetime(2013,12,10,1,9,53,977342),validate_image=true))
http://cdn.tensing.com/uploads/magazine/test_material/img_1024_600.png validated
<;?XML版本='1.0'编码='utf-8'?>;
<;feed xmlns="http://www.w3.org/2005/atom"xmlns:news="http://itunes.apple.com/2011/报摊">;<;updated>;2013-12-10t01:09:53z<;/updated>;<;entry>;<;id>;1<;/id>;<;updated>;2013-12-10t01:09:53z<;/updated>;<;published>;2013-12-10t01:10:53z<;/发布ed>;<;摘要>;这是摘要1<;/summary>;<;新闻:封面艺术图标>;<;新闻:封面艺术图标size="source" src="http://cdn.tensing.com/uploads/magazine/test_material/img_u 600.png"/>;<;/news:封面艺术图标>;<;/entry>;<;entry>;<;id>;2<;/id>;<;updated>;2013-12-09t01:09:53z<;/更新>;<;发布>;2013-12-10t01:07:53z<;/发布>;<;摘要>;这是摘要2<;/摘要>;<;新闻:封面艺术图标>;<;新闻:封面艺术图标size="source" src="http://cdn.tensing.com/uploads/magazine/test\u material/img\u1024\u600.png"/>;<;/新闻:关于封面艺术的图标和gt;lt;lt;入口>;
*[文档](http://atomgen.readthedocs.org/en/最新/)
>>[eramosse.github[github.com/erasmose]
*[linkedin][linkedin(http://www www://www.http://www.http://www linkedin.com/in/sepher)
==
创建与atom feed的v1.2兼容的apple报摊atom feed
它还可以基于atomfeed规范验证远程或本地图像
请注意,这不同于普通atom feed:[规范](https://itunesconnect.apple.com/docs/newstandatomfeedspecification.pdf)
sage
>;>import datetime
>;>from atomgen import atomgen
simple
>;>a=[{id':'1','updated':datetime.datetime(2013,12,10,1,9,53,977342),
…。发布日期:datetime.datetime(2013、12、10、1、10、53、977342),
…摘要":"这是摘要1","图标":"http://ccc.com/img.png"},
…{'id':2,'updated':datetime.datetime(2013,12,9,1,9,53,977342),
…发布日期:datetime.datetime(2013、12、10、1、7、53、977342),
…摘要":"这是摘要2","图标":"http://ccc2.com/img2.png"}"
>;>;my_atom=atomgen()
>;>;打印my_atom.run(a,update_time=datetime.datetime(2013,12,10,1,9,53,977342))
<;?XML版本='1.0'编码='utf-8'?>;
<;feed xmlns="http://www.w3.org/2005/atom"xmlns:news="http://itunes.apple.com/2011/报摊">;<;updated>;2013-12-10t01:09:53z<;/updated>;<;entry>;<;id>;1<;/id>;<;updated>;2013-12-10t01:09:53z<;/updated>;<;published>;2013-12-10t01:10:53z<;/发布lished>;<;summary>;这是摘要1<;/summary>;<;新闻:封面艺术图标>;<;新闻:封面艺术图标size="source" src="http://ccc.com/img.png"/>;<;/news:封面艺术图标>;<;/entry>;<;entry>;<;id>;2<;/id>;<;更新>;2013-12-09t01:09:53z<;/updated>;<;发布ished>;2013-12-10t01:07:53z<;/已发布>;<;摘要>;这是摘要2<;/摘要>;<;新闻:封面艺术图标>;<;新闻:封面艺术图标size="source" src="http://ccc2.com/img2.png"/>;<;/新闻:封面艺术图标>;<;/entry>;<;/feed>;
原始字典。您需要让atomgen知道与默认名称的对应关系。
>;>;b=[{'my_id':'1','when_updated':datetime.datetime(2013,12,10,1,9,53,977342),
…'发布时间:datetime.datetime(2013、12、10、1、10、53、977342),
…"总结":"这是总结1","我的图标":"http://ccc.com/img.png"},
…{我的'u id':2,'更新时':datetime.datetime(2013,12,9,1,9,53,977342),
…'发布时间:datetime.datetime(2013、12、10、1、7、53、977342),
…"摘要":"这是摘要2","MyIcon":"http://ccc2.com/img2.png"}]
>;>my_atom2=atomgen(id="my_id",published="when_published",updated="when_updated",
…summary="The_summary",icon="myicon")
>;>gt;打印my_atom2.run(b,update_time=datetime.datetime(2013,12,10,1,9,53,977342))
<;?XML版本='1.0'编码='utf-8'?>;
<;feed xmlns="http://www.w3.org/2005/atom"xmlns:news="http://itunes.apple.com/2011/报摊">;<;updated>;2013-12-10t01:09:53z<;/updated>;<;entry>;<;id>;1<;/id>;<;updated>;2013-12-10t01:09:53z<;/updated>;<;published>;2013-12-10t01:10:53z<;/发布lished>;<;summary>;这是摘要1<;/summary>;<;新闻:封面艺术图标>;<;新闻:封面艺术图标size="source" src="http://ccc.com/img.png"/>;<;/news:封面艺术图标>;<;/entry>;<;entry>;<;id>;2<;/id>;<;更新>;2013-12-09t01:09:53z<;/updated>;<;发布ished>;2013-12-10t01:07:53z<;/已发布>;<;摘要>;这是摘要2<;/摘要>;<;新闻:封面图标>;<;新闻:封面on size="source" src="http://ccc2.com/img2.png"/>;<;/新闻:封面艺术图标>;<;/entry>;<;/feed>;
发布日期:datetime.datetime(2013、12、10、1、10、53、977342),
…摘要":"这是摘要1","图标":"http://ccc.com/img.png"},
…2:{'updated':日期时间.日期时间(2013,12,9,1,9,53,977342),
…发布日期:datetime.datetime(2013、12、10、1、7、53、977342),
…摘要":"这是摘要2","图标":"http://ccc2.com/img2.png"},}
>>gt;打印我的原子。运行(c,update_time=datetime.datetime(2013,12,10,1,9,53,977342))
<;?XML版本='1.0'编码='utf-8'?>;
<;feed xmlns="http://www.w3.org/2005/atom"xmlns:news="http://itunes.apple.com/2011/报摊">;<;updated>;2013-12-10t01:09:53z<;/updated>;<;entry>;<;id>;1<;/id>;<;updated>;2013-12-10t01:09:53z<;/updated>;<;published>;2013-12-10t01:10:53z<;/发布lished>;<;summary>;这是摘要1<;/summary>;<;新闻:封面艺术图标>;<;新闻:封面艺术图标size="source" src="http://ccc.com/img.png"/>;<;/news:封面艺术图标>;<;/entry>;<;entry>;<;id>;2<;/id>;<;更新>;2013-12-09t01:09:53z<;/updated>;<;发布ished>;2013-12-10t01:07:53z<;/已发布>;<;摘要>;这是摘要2<;/摘要>;<;新闻:封面艺术图标>;<;新闻:封面艺术图标size="source" src="http://ccc2.com/img2.png"/>;<;/news:封面艺术图标>;<;/entry>;<;/feed>;
s用于输入自定义名称
>;>;d={'1':{'更新时':datetime.datetime(2013,12,10,1,9,53,977342),
…'发布时间:datetime.datetime(2013、12、10、1、10、53、977342),
…"总结":"这是总结1","我的图标":"http://ccc.com/img.png"},
…2:{"更新时":datetime.datetime(2013、12、9、1、9、53、977342),
…。发布时间:datetime.datetime(2013、12、10、1、7、53、977342),
…"摘要":"这是摘要2","myicon":"http://ccc2.com/img2.png"},}
>;>my_atom2=atomgen(id="my_id",published="when_published",updated="when_updated",
…summary="The_summary",icon="myicon")
>>gt;打印my_atom2.run(d,update_time=datetime.datetime(2013,12,10,1,9,53,977342))
<;?XML版本='1.0'编码='utf-8'?>;
<;feed xmlns="http://www.w3.org/2005/atom"xmlns:news="http://itunes.apple.com/2011/报摊">;<;updated>;2013-12-10t01:09:53z<;/updated>;<;entry>;<;id>;1<;/id>;<;updated>;2013-12-10t01:09:53z<;/updated>;<;published>;2013-12-10t01:10:53z<;/发布lished>;<;summary>;这是摘要1<;/summary>;<;新闻:封面艺术图标>;<;新闻:封面艺术图标size="source" src="http://ccc.com/img.png"/>;<;/news:封面艺术图标>;<;/entry>;<;entry>;<;id>;2<;/id>;<;更新>;2013-12-09t01:09:53z<;/updated>;<;发布ished>;2013-12-10t01:07:53z<;/已发布>;<;摘要>;这是摘要2<;/summary>;<;新闻:封面艺术图标>;<;新闻:封面艺术图标size="source" src="http://ccc2.com/img2.png"/>;<;/news:封面艺术图标>;<;/entry>;<;/feed>;
同样的原子馈送。但它可以让您灵活地使用喜欢的名称修改自己的字典键。
发布时间:datetime.datetime(2013、12、10、1、10、53、977342),
…"总结":"这是总结1","我的图标":"http://cdn.tensing.com/uploads/magazine/test_material/img_1024_600.png"},
…2:{"更新时":datetime.datetime(2013、12、9、1、9、53、977342),
…发布时间:datetime.datetime(2013、12、10、1、7、53、977342),
…"总结":"这是总结2","我的图标":"http://cdn.tensing.com/uploads/magazine/test_material/img_1024_600.png"},}
>;;my_Atom2=atomgen(id="my_ID",published="when_Published",updated="when_Updated",
…summary="The_summary",icon="myicon")
>>gt;打印(my_atom2.run(d,update_time=datetime.datetime(2013,12,10,1,9,53,977342),validate_image=true))
http://cdn.tensing.com/uploads/magazine/test_material/img_1024_600.png validated
<;?XML版本='1.0'编码='utf-8'?>;
<;feed xmlns="http://www.w3.org/2005/atom"xmlns:news="http://itunes.apple.com/2011/报摊">;<;updated>;2013-12-10t01:09:53z<;/updated>;<;entry>;<;id>;1<;/id>;<;updated>;2013-12-10t01:09:53z<;/updated>;<;published>;2013-12-10t01:10:53z<;/发布ed>;<;摘要>;这是摘要1<;/summary>;<;新闻:封面艺术图标>;<;新闻:封面艺术图标size="source" src="http://cdn.tensing.com/uploads/magazine/test_material/img_u 600.png"/>;<;/news:封面艺术图标>;<;/entry>;<;entry>;<;id>;2<;/id>;<;updated>;2013-12-09t01:09:53z<;/更新>;<;发布>;2013-12-10t01:07:53z<;/发布>;<;摘要>;这是摘要2<;/摘要>;<;新闻:封面艺术图标>;<;新闻:封面艺术图标size="source" src="http://cdn.tensing.com/uploads/magazine/test\u material/img\u1024\u600.png"/>;<;/新闻:关于封面艺术的图标和gt;lt;lt;入口>;
*[文档](http://atomgen.readthedocs.org/en/最新/)
>>[eramosse.github[github.com/erasmose]
*[linkedin][linkedin(http://www www://www.http://www.http://www linkedin.com/in/sepher)