https://github.com/andrewdarnall/xml-editing-tool
A Python tool for domain specific editing of xml files
https://github.com/andrewdarnall/xml-editing-tool
python-tools tools xml-editor
Last synced: 10 months ago
JSON representation
A Python tool for domain specific editing of xml files
- Host: GitHub
- URL: https://github.com/andrewdarnall/xml-editing-tool
- Owner: AndrewDarnall
- Created: 2024-10-27T11:48:37.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-29T00:51:52.000Z (about 1 year ago)
- Last Synced: 2025-01-20T21:57:53.224Z (11 months ago)
- Topics: python-tools, tools, xml-editor
- Language: Python
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# XML Editor Tool


---
This is a simple tool for the domain specific editing of an XML document.
The tool takes as input a directory with `.xml` files, and iteratively edits each file
searching for specific nodes within the tree representation of the tags and replaces
and add to the hard-coded target nodes.
The tool is meant to automate some time-consuming tasks which could be error-prone
and can be (and should be) handled by a machine.
---
## Requirements
| Software | Version |
|-----------|---------|
| Python |`3.10.14`|
| Pip | `23.3.1`|
| pre-commit| `2.10.1`|
You can install `pre-commit` to apply the git hooks defined in the `.pre-commit-config.yaml` by either installing it via:
1) `pip` via the command
```bash
python -m pip install pre-commit==2.10.1
```
2) package manager such as `apt` for `Debian-based` distributions:
```bash
apt-get install pre-commit
```
---
## Usage
1) Clone the repository into a directory of choice
```bash
git clone https://github.com/AndrewDarnall/XML-Editing-Tool.git
```
2) Change into the repo's `target-dir` directory
```bash
cd XML-Editing-Tool/target-dir
```
3) Move all the target `.xml` files into the `target-dir` directory
4) Run the script
```bash
python ../main.py .
```
---