AlterX - The File Transformation Toolkit
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:
Installation
pip install alterx
Quick Start
- Create a processing script (e.g.,
transform.py):
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
- Run AlterX:
# Process JSON files
alterx json -x transform.py path/to/files
Example Use Cases
- JSON Updating API URLs across multiple JSON config files
- TOML Maintaining consistent Python project TOML files
- HTML Standardizing HTML documents (adding missing tags, accessibility improvements)
- XML Processing XML sitemaps (adding/removing URLs, updating dates)
- YAML Managing Kubernetes YAML manifests (adding labels, updating image tags)
Release files for alterx 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| alterx-0.0.4.tar.gz | 24.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| alterx-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.6 kB
Release files / alterx-0.0.4.tar.gz
| Download URL | alterx-0.0.4.tar.gz |
|---|---|
| Size | 24.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
435c5dd2f80674177103a5f47d82af9a8884631b5b7a431c33dedc456f88e237
|
|
BLAKE2b-256 checksum How to use checksums |
e1068a4ca7867de823da94443db305a0a58eee3aaf947aaa4e9317c00a32f4da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.18
|
Release files / alterx-0.0.4-py3-none-any.whl
| Download URL | alterx-0.0.4-py3-none-any.whl |
|---|---|
| Size | 16.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a5ef416110c24751045b35663337d0c485d4bcbc719664dc2533f60bc599b42f
|
|
BLAKE2b-256 checksum How to use checksums |
6bfc576c1ddcdace3b913addd6b85865c431ce802e4c1ef1418d8dcaf0851a99
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.18
|