Skip to content

feat/pii date scrubbing #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

colinchambachan
Copy link

Why is this change being made?

The purpose of this PR is to sanitize text input from potentially confidential dates, such as dates of births.

Dates of birth are considered sensitive PII and are often used for identity verification. Scrubbing them ensures compliance with privacy regulations.

What is changing?

An additional function scrub_dates() has been added, which matches text found in the input against typical date formats. The function replaces dates matching regex patterns with "[REDACTED DATE]".

How did I test?

Test cases have been added to tests/test_pii_scrubber.py which test the pii scrubber against various date formats, including ISO, USA, EUR and variations of each. This includes cases where months and days are single-digit.

Assuming correct env setup, tests can be run using:

poetry run pytest tests/test_pii_scrubber.py::test_scrub_dates

@colinchambachan colinchambachan requested a review from a team as a code owner March 18, 2025 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant