python bindings for RapidXml, a C++ XML parsing library
  • C++ 88.6%
  • Python 10.6%
  • C 0.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Marc-Etienne Barrut 97b69fb4f9 bump version to 2.1.4
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-06-08 04:29:28 +02:00
rapidxml style cleanup in setvalue 2026-06-08 04:28:31 +02:00
tests sync data/cdata children when setting element value (fixes #6) 2026-06-08 03:58:31 +02:00
.gitignore first import 2015-04-11 10:57:49 +09:00
.travis.yml 3.6 & unused include 2017-05-24 10:31:19 +02:00
LICENSE Initial commit 2015-04-11 10:53:25 +09:00
MANIFEST.in version bump 2015-04-23 13:20:27 +09:00
README.md fix Python buffers & C++ doc leaks, add modern Python support (fixes #7) (#9) 2025-11-06 00:06:12 +01:00
setup.py bump version to 2.1.4 2026-06-08 04:29:28 +02:00
test-requirements.txt bump pytest to 9.0.3, bump version to 2.1.3 2026-06-08 03:53:53 +02:00

python_rapidxml

A library providing python bindings for rapidxml

Example

import rapidxml

r = rapidxml.RapidXml(b"<test/><test2>foo</test2><test></test>") # parsing from bytes
test = r.first_node("test") # get first node named test
test.name = "foo" # changing node's name to foo
r.first_node("test2").value = "bar" # changing node's value to bar

print(str(r)) # will output a prettified string of the xml document
print(r.unparse(pretty=False, raw=True)) # will output the xml document as flat bytes
print(test) # also works for nodes

with open('dump.xml', 'w') as f:
    f.write(str(r))
r = rapidxml.RapidXml("dump.xml", from_file=True) # loading from file

assert(str(r) == r.unparse(pretty=True, raw=False)) # is always True
assert(repr(r) == r.unparse(pretty=False, raw=False)) # also always True

Install

Latest Version Supported Python Versions

If you have downloaded the source code:

python setup.py install

or if you want to obtain a copy from the Pypi repository:

pip install rapidxml

Both commands will install the required package dependencies.

A distribution package can be obtained for manual installation at:

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

Source

python_rapidxml's git repo is available on GitHub, which can be browsed at github and cloned like that:

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

License

MIT license. See the LICENSE file.