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.4.tar.gz
(3.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xmlpatcher-1.0.4.tar.gz.
File metadata
- Download URL: xmlpatcher-1.0.4.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e83a776237813cc9da389b8b89b03f6a2fd562876d49dd489789ae8977d3bd58
|
|
| MD5 |
dc3c742d8cd980e80f3df5f464c07008
|
|
| BLAKE2b-256 |
f73e737029516463a948266bab8b90fc78374f83035c89be23418046af583dc0
|
File details
Details for the file xmlpatcher-1.0.4-py3-none-any.whl.
File metadata
- Download URL: xmlpatcher-1.0.4-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa49fa9311415d243df88f9183d185fd0289eab3d86b5a88292b57f42b5b55ed
|
|
| MD5 |
8d4d473290972d3aca3b1e46e7ceedb2
|
|
| BLAKE2b-256 |
34fa717321b8cccef1d19f1a7c85a0b400029ca0758698d6fd856b0a15bb543e
|