A lightweight tool for removing personal data from text before uploading to LLMs
Project description
AI Data Scrubber
The AI Data Scrubber is a lightweight privacy-focused tool designed to remove personal information from text documents before uploading them to Large Language Models (LLMs). You can use it to clean sensitive documents like resumes or contracts. It's not guaranteed to remove everything, so you should still check before you upload your file to a LLM.
It uses a mixture of regular expressions and named entity recognition models from spaCy. It's less accurate than asking a LLM to remove PII - but then you don't need to either run a LLM on your own machine, or upload your document to a LLM.
What It Does
Removes personal information like:
- Names (via AI recognition)
- Email addresses
- Phone numbers
- Street addresses & ZIP codes
- URLs
- License plates
Currently supports US formats only.
Quick Start
# Install
pip install ai-data-scrubber
# Download required language model (560MB)
python -m spacy download en_core_web_lg
# Clean your file
ai-data-scrubber your-file.txt
Usage
Command Line:
# Auto-generates output file with _scrubbed suffix
ai-data-scrubber input.txt
# Or specify output file
ai-data-scrubber input.txt -o output.txt
Python:
from ai_data_scrubber import scrub_text, scrub_file
# Scrub text directly
cleaned = scrub_text("John Smith lives at 123 Main St")
# Or scrub a file
scrub_file("input.txt", "output.txt")
Example
Before:
John Smith
123 Main Street, Apt 4B
New York, NY 10001
Email: john.smith@example.com
Phone: (555) 123-4567
After:
[NAME]
[ADDRESS], [UNIT]
New York, NY [ZIP_CODE]
Email: [EMAIL]
Phone: [PHONE]
Documentation
- Installation Guide - Detailed installation including from source
- Performance Testing - Test with 20 sample resumes
Requirements
- Python 3.10 or higher
- spaCy >= 3.5.0
- spaCy model:
en_core_web_lg
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions welcome! Feel free to submit a Pull Request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ai_data_scrubber-0.1.0.tar.gz.
File metadata
- Download URL: ai_data_scrubber-0.1.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb6f7ed41beb410ad219badb7ebd747bfbaa6cd777931fdb0351dd958df1b336
|
|
| MD5 |
325e71794fece4aafebb6eb7eb892db7
|
|
| BLAKE2b-256 |
7bb96bfb2bc51e3caf2113dd0a4a7210c997857e4d9c98a33410e02619cdf03b
|
File details
Details for the file ai_data_scrubber-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ai_data_scrubber-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3783ebc937f8dcf422d819d97b3b4b09a7fd90c1f30b013fe5a63a254e1f6821
|
|
| MD5 |
786476e3bec51893807487a1ffe9c9c9
|
|
| BLAKE2b-256 |
ba1067f13848d81f77c961155c537bfdeb9de2bbcc47992c47b11ffff754acc9
|