https://github.com/jet-logic/alterx
A powerful file processing toolkit for batch transformations of HTML, JSON, TOML, XML, and YAML files
https://github.com/jet-logic/alterx
command-line-tool file-processing html-parser json-parsing json-serialization python3 toml-parsing xml-parsing yaml-processor
Last synced: 4 months ago
JSON representation
A powerful file processing toolkit for batch transformations of HTML, JSON, TOML, XML, and YAML files
- Host: GitHub
- URL: https://github.com/jet-logic/alterx
- Owner: jet-logic
- Created: 2025-05-15T10:21:29.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-28T05:49:01.000Z (11 months ago)
- Last Synced: 2025-10-05T19:48:18.954Z (8 months ago)
- Topics: command-line-tool, file-processing, html-parser, json-parsing, json-serialization, python3, toml-parsing, xml-parsing, yaml-processor
- Language: Python
- Homepage:
- Size: 229 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AlterX - The File Transformation Toolkit
[](https://www.python.org/)
[](https://github.com/jet-logic/alterx/actions)
[](https://pypi.python.org/pypi/alterx/)
AlterX is a powerful command-line tool for batch processing and transforming files in various formats. It provides a consistent framework for modifying HTML, JSON, TOML, XML, and YAML files with custom Python logic.
## Features
- **Multi-format support**: Process HTML, JSON, TOML, XML, and YAML files
- **Extension system**: Define transformations in Python scripts
- **Smart modification**: Only changes files that need updates
- **Batch processing**: Recursively process entire directories
- **Dry run mode**: Test changes before applying them
- **Comprehensive logging**: Detailed output about modifications
## ☕ Support
If you find this project helpful, consider supporting me:
[](https://ko-fi.com/B0B01E8SY7)
## Installation
```bash
pip install alterx
```
## Quick Start
1. Create a processing script (e.g., `transform.py`):
```python
def init(app):
app.defs['VERSION'] = "2.0.0"
def process(doc, file_info, app):
if 'version' in doc:
doc['version'] = app.defs['VERSION']
return True
```
2. Run AlterX:
```bash
# Process JSON files
alterx json -x transform.py path/to/files
```
### Example Use Cases
- [JSON](Example-json.md) Updating API URLs across multiple JSON config files
- [TOML](Example-toml.md) Maintaining consistent Python project TOML files
- [HTML](Example-html.md) Standardizing HTML documents (adding missing tags, accessibility improvements)
- [XML](Example-xml.md) Processing XML sitemaps (adding/removing URLs, updating dates)
- [YAML](Example-yaml.md) Managing Kubernetes YAML manifests (adding labels, updating image tags)