scrubadub
Clean personally identifiable information from dirty dirty text.
What it is and what it does
Scrubadub is a text anonymization library that identifies and replaces sensitive personal information in unstructured text. It ships with built-in detectors for common PII categories—names, emails, phone numbers, credit card numbers, dates of birth, social security numbers, and others—and replaces matches with standardized placeholders like {{EMAIL}} or {{PHONE}}. The library is highly configurable, allowing you to enable or disable specific detectors, customize replacement strategies, and adapt behavior for different languages and regions through optional extensions.
The package depends on several NLP and data-parsing libraries (textblob, phonenumbers, python-stdnum, dateparser, scikit-learn, faker, catalogue, and typing-extensions) to perform pattern matching and validation across its detector suite. It is intended for workflows where you need to prepare datasets for sharing, testing, or analysis while protecting individual privacy—common in data science, compliance, and software testing contexts.
Use it for:
- Prepare real customer datasets for sharing with external teams or for use in testing environments without exposing actual PII.
- Anonymize support tickets, chat logs, or user feedback before storing them in non-secure systems or using them for model training.
- Redact sensitive information from documents before publishing case studies, examples, or internal documentation.
- Generate synthetic test data by scrubbing production logs and then using faker to regenerate realistic but non-real personal details.
- Audit and clean data pipelines to ensure PII is not accidentally leaked in logs, error messages, or intermediate outputs.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Detects and replaces personally identifiable information (names, emails, phone numbers, credit cards, dates of birth, social security numbers, and more) in free text with anonymized placeholders.
Yes, with conditions. Scrubadub is stable, permissively licensed, and has no known security vulnerabilities, making it suitable for production use in established data anonymization workflows. However, maintenance is dormant, so if you need active bug fixes or feature development, evaluate whether the package's current detector coverage meets your needs. For standard use cases (email, phone, credit card, SSN redaction), it remains a solid choice.
Install
scrubadub on PyPI
pip
pip install scrubadubuv
uv add scrubadubpoetry
poetry add scrubadubInstalling scrubadub
Before you install
Low install friction with a pure-Python wheel distribution. Maintenance is dormant—last release was in 2023—but the package is marked Production/Stable and has seen no security vulnerabilities. Suitable for established use cases where active development is not required.
License in practice
Licensed under MIT (permissive), allowing use in commercial and private projects with minimal restrictions. No license-related barriers to adoption.
Quickstart
pip install scrubadub
import scrubadub
text = "Contact me at example@example.com or call"
print(scrubadub.clean(text))
Requires Python 3.6 or later; Python 2.7 and 3.5 are not supported in this version.
Verify before relying
- Accuracy and recall rates for each detector type across different text formats and languages.
- Performance characteristics when processing large documents or high-volume text streams.
- How well address detection works for non-US/GB/CA regions and whether optional extensions are necessary for production use.
- Whether the dormant maintenance status affects compatibility with recent Python 3.x releases.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 8 — textblob, phonenumbers, python-stdnum, dateparser, catalogue, scikit-learn, typing-extensions, faker |
| Maintenance | dormant — 1,078 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,470,289/month — #3,049 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: scrubadub-2.0.1-py3-none-any.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
argus-redactDetects and redacts personally identifiable…
permissive · top 15,000 on PyPI
presidio-image-redactorDetects and redacts personally identifiable…
permissive · top 15,000 on PyPI
presidio-analyzerDetects personally identifiable information…
permissive · top 5,000 on PyPI
sherlock-projectSearches for usernames across 400+ social…
permissive · top 15,000 on PyPI
presidio-anonymizerReplaces detected PII text entities with…
permissive · top 5,000 on PyPI
reqifReqIF is a Python library for parsing,…
permissive · top 15,000 on PyPI
openmedExtracts medical entities and personally…
permissive · top 5,000 on PyPI
commonregexExtracts dates, times, emails, phone numbers,…
permissive · top 15,000 on PyPI
pyapPyap detects and parses postal addresses from…
permissive · top 15,000 on PyPI
pyap2Pyap2 detects and parses postal addresses from…
permissive · top 15,000 on PyPI