python rapidxml库

RapidXml的Python项目详细描述


为rapidxml提供python绑定的库

示例

importrapidxmlr=rapidxml.RapidXml(b"<test/><test2>foo</test2><test></test>")# parsing from bytestest=r.first_node("test")# get first node named testtest.name="foo"# changing node's name to foor.first_node("test2").value="bar"# changing node's value to barprint(str(r))# will output a prettified string of the xml documentprint(r.unparse(pretty=False,raw=True))# will output the xml document as flat bytesprint(test)# also works for nodeswithopen('dump.xml','w')asf:f.write(str(r))r=rapidxml.RapidXml("dump.xml",from_file=True)# loading from fileassert(str(r)==r.unparse(pretty=True,raw=False))# is always Trueassert(repr(r)==r.unparse(pretty=False,raw=False))# also always True

安装

Latest VersionSupported Python Versions

如果您下载了源代码:

python setup.py install

或者,如果您想从PYPI存储库获取副本:

pip install rapidxml

这两个命令都将安装所需的包依赖项。

可在以下位置获取分发包以进行手动安装:

http://pypi.python.org/pypi/RapidXml

来源

python_rapidxml的git repo在github上可用,可以浏览 在github和克隆 像这样:

git clone https://github.com/Arzaroth/python_rapidxml.git

许可证

麻省理工学院执照。请参阅许可证文件。

开发状态

Build Status

这个项目目前正在开发中。

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

推荐PyPI第三方库


热门话题
javascript节点js require()和Rhino Shell load()之间的区别是什么?   While循环中的java If语句   java GXT如何在XTemplate中显示treeobject?   如何将黑白图像加载到二进制文件中?   java ORMLite不知道如何存储班级航班。扫描仪。modelFX。机场航空公司的AirlineFx。使用另一个类或自定义持久器   java组织。阿帕奇。德比。客户是SqlException JSP和JSTL查询   spring如何将clob数据分配给java变量   java从上的表获取数据(Spring)   javaphp使用Exec执行带有用户定义参数的Jar文件   java jsonschema2pojo:引用相同类型的对象   使用原语从Scala调用Java vararg方法   java ClassNotFoundException:ClientBuilder Jersey 2.25.1 Tomcat 9.0   Android(Java)cr_BindingManager:无法调用determinedVisibility()从未看到pid的连接:   Java使用LocalTime类比较没有日期的时间   Java如何初始化对象的参数?