scrubadub
Python library that removes personally identifiable information such as names, emails, and phone numbers from free text.
At a Glance
About scrubadub
scrubadub is an open-source Python package maintained by LeapBeyond that removes personally identifiable information (PII) from free text. It replaces detected items such as emails and phone numbers with placeholder markers, and it installs with pip. The documentation lists v2.0.1 as the latest GitHub release, published 2023-09-01.
What It Is
scrubadub is a text-anonymization library for Python scripts. Given a string, it detects sensitive items and substitutes anonymous markers. For example, scrubadub.clean() turns an email address and phone number into {{EMAIL}} and {{PHONE}}. It is aimed at cases where there may or may not be extra metadata about the people being anonymized.
What It Detects
The documentation lists support for names, email addresses, addresses and postal codes (US, GB, CA), credit card numbers, dates of birth, URLs, phone numbers, username and password combinations, Skype and Twitter usernames, social security numbers (US) and GB national insurance numbers, GB tax numbers, and GB driving licence numbers. Detectors are enabled by default or can be added as optional ones.
Configuration and Extensibility
Users can add, remove, and configure detectors, customize filth markers, and apply post-processors. Custom detectors can be built, including regex-based and localized ones, and are registered for auto-loading. Optional companion packages (scrubadub_address, scrubadub_spacy, scrubadub_stanford) add address and name detection using extra dependencies. The docs also cover localization for different regions and languages, plus an accuracy and comparison module for measuring precision and recall.
Setup Path
Install with pip install scrubadub. It requires Python 3.6 or later; v1.2.2 is the last version supporting Python 2.7 and 3.5.
Community Discussions
Be the first to start a conversation about scrubadub
Share your experience with scrubadub, ask questions, or help others learn from your insights.
Pricing
Open Source
scrubadub Python library under the Apache License 2.0, free to use, modify and distribute.
- Apache License 2.0
- Install via pip install scrubadub
- Removes names, email addresses, phone numbers, credit card numbers, URLs and other PII from free text
- Configurable detectors and post-processors
- Localisation for different languages and regions
Capabilities
Key Features
- Removes PII from free text
- Detects names, emails, phone numbers, credit cards, URLs, and dates of birth
- Detects addresses and postal codes (US, GB, CA)
- Detects SSNs, GB national insurance, tax, and driving licence numbers
- Configurable detectors and post-processors
- Customizable filth markers
- Custom regex-based detector creation
- Localization for regions and languages
- Accuracy measurement with precision and recall
