Skip to content
This repository was archived by the owner on Nov 7, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ uv run pytest tests/ -v

# Scrub text
uv run python -c "
from openadapt_privacy import PresidioScrubber
scrubber = PresidioScrubber()
from openadapt_privacy import PresidioScrubbingProvider
scrubber = PresidioScrubbingProvider()
text = 'Contact John Smith at john@example.com or 555-123-4567'
print(scrubber.scrub_text(text))
"

# Scrub dictionary
uv run python -c "
from openadapt_privacy import scrub_dict, PresidioScrubber
scrubber = PresidioScrubber()
from openadapt_privacy import scrub_dict, PresidioScrubbingProvider
scrubber = PresidioScrubbingProvider()
data = {'name': 'John Smith', 'email': 'john@example.com'}
print(scrub_dict(data, scrubber))
"
Expand All @@ -45,34 +45,34 @@ print(scrub_dict(data, scrubber))

```
openadapt_privacy/
base.py # Base classes: Scrubber, ScrubbingProvider
base.py # Base classes: ScrubbingProvider, TextScrubbingMixin
config.py # PrivacyConfig dataclass
loaders.py # Recording/Action/Screenshot loaders
pipelines/dicts.py # Dictionary scrubbing utilities
providers/presidio.py # PresidioScrubber (primary implementation)
providers/presidio.py # PresidioScrubbingProvider (primary implementation)
```

## Key Components

### PresidioScrubber
### PresidioScrubbingProvider
Primary scrubber using Presidio NER and spaCy:
- Detects: PERSON, EMAIL_ADDRESS, PHONE_NUMBER, US_SSN, CREDIT_CARD, DATE_TIME, LOCATION
- `scrub_text(text)` - Redact PII from text
- `scrub_image(image)` - OCR + redact PII regions

### Text Scrubbing
```python
from openadapt_privacy import PresidioScrubber
scrubber = PresidioScrubber()
from openadapt_privacy import PresidioScrubbingProvider
scrubber = PresidioScrubbingProvider()
text = "Contact John Smith at john@example.com"
# Output: "Contact <PERSON> at <EMAIL_ADDRESS>"
print(scrubber.scrub_text(text))
```

### Dictionary Scrubbing
```python
from openadapt_privacy import scrub_dict, PresidioScrubber
scrubber = PresidioScrubber()
from openadapt_privacy import scrub_dict, PresidioScrubbingProvider
scrubber = PresidioScrubbingProvider()
action = {"text": "Email john@example.com", "title": "User John Smith"}
scrubbed = scrub_dict(action, scrubber)
```
Expand Down
Loading
Loading