Skip to main content

A convenient library for patching XML files with XPath.

Project description

XML Patcher

Latest release on pypi.org

A convenient library for patching XML files with XPath.

Usage example:

from xmlpatcher import XMLDocument
from xmlpatcher.patches import SetValue, Remove

document = XMLDocument("./example.xml")
document.patch(
    SetValue("/Book/@color", "red"),
    Remove("/Book/Page[1]")
)
document.save()

The above code will transform this file:

<Book color="blue">
    <Page>Welcome</Page>
    <Page>Goodbye</Page>
</Book>

Into this:

<Book color="red">
    <Page>Goodbye</Page>
</Book>

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

xmlpatcher-1.0.3-py3-none-any.whl (7.1 kB view hashes)

Uploaded Python 3

Supported by

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