--- id: presidio-anonymizer version: "2.2.364" license: MIT license_treatment: permissive maintenance: active --- # presidio-anonymizer — Presidio Anonymizer package - replaces analyzed text with desired values. License: permissive · Maintenance: active · Downloads: 4.9M/mo ## What it is and what it does Presidio Anonymizer is a Python module that takes detected PII entities and replaces them with anonymized values according to configured operators. It handles the transformation side of PII protection: given a text and a list of entity locations (typically from a separate analyzer), it applies anonymization strategies like redaction, masking, hashing, encryption, or custom transformations. The package also includes a deanonymizer for reversing encryption-based anonymization. The module is designed to work downstream of PII detection—you provide the text, the detected entity spans and types, and the anonymization rules you want applied. It handles overlapping entity spans by selecting based on confidence score or span containment, and supports batch operations for lists and nested dictionaries. The core anonymizers use standard algorithms (AES for encryption, SHA256/SHA512 for hashing) and rely on cryptography for secure operations. Use it for: - Redact sensitive customer data in logs or reports before sharing with non-privileged teams - Hash or mask credit card numbers and SSNs in datasets for analytics while preserving some structure - Encrypt detected names and email addresses in text, then decrypt them later with the correct key - Batch-process lists of documents to remove PII before archival or compliance export - Replace detected phone numbers with placeholder text in call transcripts or support tickets ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Replaces detected PII text entities with anonymized values using configurable operators like redaction, masking, hashing, encryption, or custom functions. Yes. The package is actively maintained, has no known vulnerabilities, installs with minimal friction, and solves a concrete problem in data privacy workflows. It's most useful when paired with a PII detector (like presidio-analyzer), but the anonymization logic itself is solid and well-documented. Install if you need to transform detected PII in text after detection. ## Install pip install presidio-anonymizer uv add presidio-anonymizer poetry add presidio-anonymizer ## Installing presidio-anonymizer Before you install: Low friction install with a single runtime dependency (cryptography). Active maintenance with a recent release 23 days ago and 10484 repository stars. License in practice: MIT license permits commercial and private use with minimal restrictions—suitable for most projects. Quickstart: pip install presidio-anonymizer from presidio_anonymizer import AnonymizerEngine from presidio_anonymizer.entities import RecognizerResult, OperatorConfig engine = AnonymizerEngine() result = engine.anonymize( text="My name is Bond, James Bond", analyzer_results=[RecognizerResult(entity_type="PERSON", start=11, end=15, score=0.8)], operators={"PERSON": OperatorConfig("replace", {"new_value": "REDACTED"})} ) Requires analyzer results (entity spans and types) as input—typically from presidio-analyzer or another PII detection tool. Verify before relying: - Performance characteristics with large text volumes or many overlapping entities - Compatibility with custom analyzer output formats beyond RecognizerResult - Whether AHDS Surrogate operator is production-ready or experimental ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 4.9M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags PII anonymization, text redaction, data masking, sensitive data replacement, privacy text processing, entity anonymization, deanonymization decrypt, pii-redaction, data-privacy, text-anonymization [View on SkillFed](https://skillfed.io/packages/presidio-anonymizer) · [View on PyPI](https://pypi.org/project/presidio-anonymizer/)