Metadata-Version: 2.1
Name: xml-safe-mod
Version: 0.1.0
Summary: A utility for safely making updates to XML configuration files.
Project-URL: Documentation, https://github.com/kgaughan/xml-safe-mod
Project-URL: Issues, https://github.com/kgaughan/xml-safe-mod/issues
Project-URL: Source, https://github.com/kgaughan/xml-safe-mod
Author-email: Keith Gaughan <k@stereochro.me>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.7
Description-Content-Type: text/markdown

# xml-safe-mod

A small utility for safely making updates to XML configuration files.

It aims to give a safer alternative to using sed when updating XML configuration files, both by avoiding leaking secrets and by making the updates themselves safe and atomic.

## Usage

```sh
# In-place update
echo '{"secret1": "password1"}' | xml-safe-mod --src /etc/daemon/config.xml --in-place --set secret1 ./xpath/expression
# Use a template file to generate another file
echo '{"secret1": "password1"}' | xml-safe-mod --src /etc/daemon/config.xml.in --dest /etc/daemon/config.xml --owner daemon --group daemon --perms 600 --set secret1 ./xpath/expression
```

It would support the [ElementTree subset of XPath](https://docs.python.org/3/library/xml.etree.elementtree.html#supported-xpath-syntax).
