cate transform
Overview
Transform a single file by detecting and replacing sensitive entities (PII). Supports placeholder, masking, and lookup table strategies. Works with text, markdown, HTML, PDF, Word, JSON, YAML, and CSV files.
Usage
python -m src.anonymization.cli transform FILE [OPTIONS]
Options
| Option | Description | Default |
|---|---|---|
FILE | Input file to transform (positional, required) | -- |
-o, --output | Output file path | <name>_anonymized.<ext> |
-c, --config | Path to CATE configuration file | -- |
-s, --strategy | Strategy: placeholder, mask, lookup | placeholder |
-n, --dry-run | Show what would be done without writing | false |
--encoding | File encoding | utf-8 |
Prerequisites
- Repo: content-conductor
- Install:
pip install -r requirements.txtfrom repo root
Examples
Basic transformation (placeholder strategy)
python -m src.anonymization.cli transform document.txt
Masking strategy with config
python -m src.anonymization.cli transform data.json -s mask -c cate.yaml
Dry run to preview changes
python -m src.anonymization.cli transform data.json --dry-run
Explicit output path
python -m src.anonymization.cli transform input.pdf -o output.pdf
Related Commands
cc cate analyze-- detect PII without making changescc cate batch-- batch-process multiple files