Skip to main content

A powerful file processing toolkit for batch transformations of HTML, JSON, TOML, XML, and YAML files

Project description

AlterX - The File Transformation Toolkit

Python Version Tests Status PyPI version fury.io

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:

ko-fi

Installation

pip install alterx

Quick Start

  1. 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
  1. 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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alterx-0.0.4.tar.gz (24.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alterx-0.0.4-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file alterx-0.0.4.tar.gz.

File metadata

  • Download URL: alterx-0.0.4.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

Hashes for alterx-0.0.4.tar.gz
Algorithm Hash digest
SHA256 435c5dd2f80674177103a5f47d82af9a8884631b5b7a431c33dedc456f88e237
MD5 a7bfc07a7047711e462cd8ad39f1f8a2
BLAKE2b-256 e1068a4ca7867de823da94443db305a0a58eee3aaf947aaa4e9317c00a32f4da

See more details on using hashes here.

File details

Details for the file alterx-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: alterx-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for alterx-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a5ef416110c24751045b35663337d0c485d4bcbc719664dc2533f60bc599b42f
MD5 3bb9ac52ecf1a1c10c628091ee0cf952
BLAKE2b-256 6bfc576c1ddcdace3b913addd6b85865c431ce802e4c1ef1418d8dcaf0851a99

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page