presidio-analyzer
Presidio Analyzer package
What it is and what it does
Presidio Analyzer is a Python service that scans unstructured text to find and identify personally identifiable information (PII) such as phone numbers, email addresses, and other sensitive data. It comes with a set of predefined recognizers that use regex, spaCy-based named entity recognition, and other detection logic to identify PII entities. The package can be extended with custom recognizers for domain-specific or specialized PII types.
The analyzer supports both traditional pattern-based detection and modern language model-based approaches. For LLM-based detection, it integrates with Ollama (for local, privacy-preserving deployments) and Azure OpenAI (for cloud-based detection). The core engine loads a spaCy NLP model by default and orchestrates multiple recognizers to produce a comprehensive analysis of detected entities in a given text.
Use it for:
- Scan customer support tickets or chat logs to identify and redact PII before storage or sharing.
- Validate data pipelines to ensure sensitive information is not leaked in logs or exported datasets.
- Build privacy-compliance workflows that detect PII in documents before they are processed or archived.
- Extend with custom recognizers to detect domain-specific sensitive data (e.g., medical record numbers, financial account identifiers).
- Deploy locally via Ollama for on-premise PII detection without sending text to external APIs.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Detects personally identifiable information (PII) entities in text using regex, named entity recognition, and language models, with support for custom recognizers and multiple LLM providers.
Yes. Presidio Analyzer is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and offers low-friction installation. It solves a concrete privacy problem with both out-of-the-box recognizers and extensibility for custom needs. The choice between pattern-based and LLM-based detection gives flexibility for different accuracy and privacy trade-offs.
Install
presidio-analyzer on PyPI
pip
pip install presidio-analyzeruv
uv add presidio-analyzerpoetry
poetry add presidio-analyzerInstalling presidio-analyzer
Before you install
Low friction installation with a wheel distribution. Active maintenance with a recent release (23 days old) and strong repository activity (10483 stars). Supports modern Python versions (3.10–3.14).
License in practice
MIT license (permissive) allows free use, modification, and distribution with minimal restrictions, making it suitable for commercial and open-source projects.
Quickstart
pip install presidio-analyzer
from presidio_analyzer import AnalyzerEngine
analyzer = AnalyzerEngine()
results = analyzer.analyze(
text="My phone number is 212-555-5555",
entities=["PHONE_NUMBER"],
language='en'
)
print(results)
Requires spaCy NLP model to be downloaded; the AnalyzerEngine loads it by default on first use. For GPU acceleration on Linux with NVIDIA, cupy-cuda12x or matching CUDA version must be installed separately.
Verify before relying
- Whether predefined recognizers cover all common PII entity types or if custom recognizers are required for specific use cases.
- Performance characteristics (latency, throughput) for large-scale text analysis.
- Whether LangExtract recognizers (Ollama, Azure OpenAI) require additional setup beyond the base install.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<3.15,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 8 — click, numpy, phonenumbers, pydantic, pyyaml, regex, spacy, tldextract |
| Maintenance | actively maintained — 23 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 6,771,284/month — #1,852 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: presidio_analyzer-2.2.364-py3-none-any.whl
Keywords: presidio_analyzer
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
presidio-anonymizerReplaces detected PII text entities with…
permissive · top 5,000 on PyPI
presidio-image-redactorDetects and redacts personally identifiable…
permissive · top 15,000 on PyPI
argus-redactDetects and redacts personally identifiable…
permissive · top 15,000 on PyPI
scrubadubDetects and replaces personally identifiable…
permissive · top 5,000 on PyPI
recognizers-text-choiceRecognizes and resolves entities like numbers,…
permissive · top 15,000 on PyPI
openmedExtracts medical entities and personally…
permissive · top 5,000 on PyPI
recognizers-text-numberRecognizes and extracts numeric entities…
permissive · top 15,000 on PyPI
recognizers-textRecognizes and extracts entities like numbers,…
permissive · top 15,000 on PyPI
glinerGLiNER is a lightweight framework for named…
permissive · top 15,000 on PyPI
recognizers-text-date-timeRecognizes and resolves date and time entities…
permissive · top 15,000 on PyPI