A convenient library for patching XML files with XPath.
Project description
XML Patcher
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 Distribution
xmlpatcher-1.0.2.tar.gz
(5.4 kB
view hashes)
Built Distribution
Close
Hashes for xmlpatcher-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed230b21492cfd30b25fafc77f3aa513b82f2d0436ea2eec28ee38834b5d23ed |
|
MD5 | ae507a039290478c5ffa052a4877ef9b |
|
BLAKE2b-256 | 555a1364084072aad03be70937fa727366f286b34b50b57d2f9f33c49634d288 |