skillfed

presidio-analyzer

Presidio Analyzer package

presidio-analyzer v2.2.364 6.8M downloads/30d#1,852 on PyPI10,483
Permissive license MIT Active released

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-analyzer

uv

uv add presidio-analyzer

poetry

poetry add presidio-analyzer

Installing 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

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

PII detection in textpersonally identifiable information recognitionnamed entity recognition NERdata privacy scanningsensitive data detectionPII analyzertext privacy masking
pii-detectionprivacy-compliancenlp

More Security packages