Python简单结构的XML序列化(反)序列化器。
项目描述
概述
xmlpolymerase是一个将Python结构序列化和反序列化为XML的简单而强大的工具。可能的结构有字符串、整数、浮点数、布尔值、列表和字典。
聚合酶的主要功能是在复制和转录过程中,在新DNA或RNA模板上聚合新的DNA或RNA。(引用:维基百科 http://en.wikipedia.org/wiki/Polymerase)
用法
这是一个纯Python模块。API很简单,更多内容请参阅docstrings,以下是一个示例。
>>> from odict import OrderedDict >>> teststructure = OrderedDict() >>> teststructure['one'] = 'Eins' >>> teststructure['two'] = 'Zwei' >>> teststructure['three'] = 'Drei' >>> teststructure['four'] = [True, 2, '3-2', 42.23] >>> domnode = serialize(structure, nodename='object') >>> print domnode.toprettyxml() <object> <one> Eins </one> <two> Zwei </two> <three> Drei </three> <four type="list"> <entry type="bool"> True </entry> <entry type="int"> 2 </entry> <entry> 3-2 </entry> <entry type="float"> 42.23 </entry> </four> </object> <BLANKLINE>
>>> structure = deserialze(domnode) OrderedDict([('one', 'Eins'), ('two', 'Zwei'), ('three', 'Drei'), ('four', [True, 2, '3-2', 23.42])])
感谢
Nicola Larosa和Michael Foord为OrderedDict实现所做的贡献,该实现已使用并复制(未经修改)到本包的odict.py中。代码在BSD许可证下发布。有关详细信息,请参阅文件内容。
许可证
除odict.py之外的所有代码均受GNU通用公共许可证GPL 2.0或更高版本的约束。
反馈、错误报告等
如果您想给作者关于此产品的反馈,请给dev@bluedynamics.com发送邮件。
如果您可以访问 plone.org collective,您可能希望直接向主分支提交错误修复,或在分支上进行增强。无论如何,作者都乐意收到有关这些更改的简要邮件。
– Jens Klein <jens@bluedynamics.com>
项目详情
关闭
xmlpolymerase-1.1.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | fb5dac027b0e09db419488b068b9793bb93c640c8d16da844ef522f00c5e4438 |
|
MD5 | 7a35b4f4b8679dc1c7400dd6f53ec68d |
|
BLAKE2b-256 | f0fc38c1a055bb29c6848280669766a5f74614926dc0fb6d3a1fe5024fa24653 |