创建苹果报摊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)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java获取TaskCompletionSource工作(Firestore的Android任务)   从PNG文件获取java或信息   neo4j嵌入式版本2.3.8的java NotInTransactionException   OSGI框架的java Eclipse启动配置在Mac上不起作用   java svn:“预提交”挂钩失败,输出错误:   java中ResourceBundle的io查询   java声明变量的最佳方法是什么?遵循下面的例子?   java如何在log4j中获得不同的记录器?   hibernate错误“java.lang.NoSuchMethodError:org.jboss.logging.Logger.getMessageLogger”   swing将JPanel保存为图像   eclipse(Java Spigot)我的PlayerInteractEvent有问题   使用java nio从FileChannel读取的字符串   java Eclipse无法清理生成输出   安卓对Eclipse java组件中的代码行数有限制吗   java Android Studio将应用程序推到手机上,不会让我   针对具有两个编辑器的页面的selenium java代码自动化   Java正则表达式:负前瞻   JavaJPA:基于实例变量将实体动态映射到表