ReplaceText | Batch Text Replacement with Dictionaries
Description: Replace text in files based on dictionaries. Bidirectional replacement, configurable ignore patterns, Python CLI tool.

🔄

# ReplaceText

Batch text replacement powered by dictionaries. Replace keys with values or values with keys across entire directories.

Python 3.8+ Poetry Bidirectional GPL-3.0
View on GitHub Documentation
`git clone https://github.com/cainky/ReplaceText.git && cd ReplaceText && poetry install`

## Features

🔁

### Bidirectional Replacement

Replace keys with values or values with keys. Perfect for encoding/decoding or reversible transformations.

📚

### Multiple Dictionaries

Define multiple replacement dictionaries in one config file and switch between them easily.

🚫

### Smart Ignore Patterns

Skip files by extension, prefix, or entire directories. Never accidentally modify binaries or dependencies.

📁

### Batch Processing

Process entire directories at once. Recursively replace text across all matching files.

⚙️

### JSON Configuration

Simple JSON config file for dictionaries and ignore patterns. Easy to version control.

🎯

### Auto-Select Dictionary

If only one dictionary exists, it's automatically selected. No extra prompts needed.

## Quick Start

config.json

    {
      "dictionaries": {
        "obfuscate": {
          "password": "p4ssw0rd",
          "admin": "4dm1n",
          "secret": "s3cr3t"
        }
      },
      "ignore_extensions": [".exe", ".dll", ".bin"],
      "ignore_directories": ["node_modules", "venv", ".git"],
      "ignore_file_prefixes": [".", "_"]
    }

Terminal

    # Run the replacement tool
    $ poetry run python replace_text/replace_text.py

    # Select direction:
    Enter '1' for keys-to-values
    Enter '2' for values-to-keys

    # Enter folder path and dictionary name
    # All matching files will be processed!