PyForge is sold only here, on the official py-forge.com website — beware of imitations.

Back to the catalog
DataMaskAI & Automation

DataMask

#python#automation#microsaas

Empower your business without risking privacy. DataMask delivers real-time, developer-first data obfuscation that preserves critical utility for AI, testing, and analytics. Effortlessly achieve GDPR and HIPAA compliance while neutralizing breach threats. Deploy in seconds, scale infinitely, and unlock your data’s potential safely. Protect assets, accelerate growth—get DataMask today.

Read the technical deep-diveReal-Time Data Obfuscation for AI Pipelines with DataMask
main.pymain.py — sample excerpt in the tool's style
#!/usr/bin/env python3
"""
DataMask - Real-time developer-first data obfuscation engine.

Provides high-performance, utility-preserving data masking and anonymization
for sensitive payloads. Designed for seamless integration into AI pipelines,
testing environments, and analytics workloads ensuring GDPR and HIPAA compliance.

Features:
- Deterministic and randomized masking strategies for PII/PHI.
- Context-aware schema preservation for structured JSON and tabular data.
- Zero-dependency, real-time stream and batch processing capabilities.
- Built-in tokenization engine with format-preserving encryption (FPE).
- Configurable compliance presets for HIPAA, GDPR, and PCI-DSS.

Usage:
    $ python main.py --config mask_config.json --input input.json
    $ python main.py --preset hipaa --stream < raw_feed.log
"""

import enum
import hashlib
import logging
import re
from dataclasses import dataclass
from typing import Any, Dict, List, Optional, Pattern


class MaskingStrategy(enum.Enum):
    """Supported data transformation strategies."""
    REDACT = "redact"
    HASH = "hash"
    TOKENIZE = "tokenize"
    NOISE = "noise"
    SYNTHETIC = "synthetic"


@dataclass(frozen=True)
class MaskingRule:
    """Configuration rule defining target fields and applied strategy."""
    pattern: Pattern[str]
    strategy: MaskingStrategy
    salt: Optional[str] = None
    replacement: str = "[REDACTED]"


class DataMaskEngine:
    """Core engine responsible for parsing and transforming sensitive payloads."""

    def __init__(self, rules: List[MaskingRule], secret_key: str = "") -> None:
        self._rules = rules
        self._secret_key = secret_key
        self._logger = logging.getLogger("datamask.engine")

# ... the full file ships with your download