Skip to main content

Python RapidXml Library

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rapidxml-2.1.3.tar.gz (34.3 kB view details)

Uploaded Source

File details

Details for the file rapidxml-2.1.3.tar.gz.

File metadata

  • Download URL: rapidxml-2.1.3.tar.gz
  • Upload date:
  • Size: 34.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for rapidxml-2.1.3.tar.gz
Algorithm Hash digest
SHA256 2a83c37a1599eb8430ae6e371a563f5f068269e23528d8186144104e54a78b0b
MD5 02e5dc0588fb10a2cf9925de82cbea4b
BLAKE2b-256 f873761126a20d9d52924be46bdb17f80343ede8cd3fccd12ab91f8149890f0c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page