presidio-anonymizer
Presidio Anonymizer package - replaces analyzed text with desired values.
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 on this page — 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
presidio-anonymizer on PyPI
pip
pip install presidio-anonymizeruv
uv add presidio-anonymizerpoetry
poetry add presidio-anonymizerInstalling 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 the current Python release (<3.15,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — cryptography |
| Maintenance | actively maintained — 23 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,936,435/month — #2,194 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: presidio_anonymizer-2.2.364-py3-none-any.whl
Keywords: presidio_anonymizer
Tags
More Security packages
Provides Python bindings to the FreeDesktop.org…
permissive · top 1,000 on PyPI
msalMSAL for Python handles OAuth2 and OpenID…
permissive · top 1,000 on PyPI
joserfcjoserfc implements JOSE standards (JWS, JWE,…
permissive · top 1,000 on PyPI
AuthlibAuthlib provides a complete implementation of…
permissive · top 1,000 on PyPI
argon2-cffi-bindingsProvides low-level CFFI bindings to the…
permissive · top 1,000 on PyPI
adalADAL for Python authenticates applications with…
permissive · top 1,000 on PyPI
microsoft-security-utilities-secret-maskerDetects and masks sensitive data in text using…
permissive · top 5,000 on PyPI
presidio-analyzerDetects personally identifiable information…
permissive · top 5,000 on PyPI
presidio-image-redactorDetects and redacts personally identifiable…
permissive · top 15,000 on PyPI
django-anonAnonymizes Django model data in place using…
permissive · top 15,000 on PyPI
argus-redactDetects and redacts personally identifiable…
permissive · top 15,000 on PyPI
django-cryptography-django5Encrypts and decrypts data in Django models…
permissive · top 15,000 on PyPI
scrubadubDetects and replaces personally identifiable…
permissive · top 5,000 on PyPI
django-fernet-fields-v2Provides Fernet symmetric encryption for Django…
permissive · top 5,000 on PyPI
django-fernet-encrypted-fieldsProvides Django model fields that encrypt data…
unclear · top 15,000 on PyPI
django-cryptographyWraps Python's cryptography library to add…
permissive · top 15,000 on PyPI