A powerful file processing toolkit for batch transformations of HTML, JSON, TOML, XML, and YAML files
Project description
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 Shown
- 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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 alterx-0.0.3.tar.gz.
File metadata
- Download URL: alterx-0.0.3.tar.gz
- Upload date:
- Size: 24.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac45409ff6967caa0f2edd0ceca073dc222d62b1f5179982f35f2f941979ebfb
|
|
| MD5 |
7b1a66b5fbea1cd16a29d32d6748c67c
|
|
| BLAKE2b-256 |
c4d03870ecbdae7d526145b893a8ae5cd05b80bb9a9ed7926ec6c32fd6cf7824
|
File details
Details for the file alterx-0.0.3-py3-none-any.whl.
File metadata
- Download URL: alterx-0.0.3-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd6ad658d42164a99d8615423868064e5137d5ceac2eaff52c452407580ab3a2
|
|
| MD5 |
604b32afd79aafa5ba3dd257af69c3b5
|
|
| BLAKE2b-256 |
e8f2c2b747b2811addaf869714b1d711f96d29e3bacb5ee7b0e7a9079a179269
|