Download src/security/pii_patterns.py from DataEyond/Agentic-Service-Data-Eyond-Catalog: direct link, hf CLI and curl.
- Browser
- Download file 625 Bytes
-
https://huggingface.co/spaces/DataEyond/Agentic-Service-Data-Eyond-Catalog/resolve/717452f69ec32394dea2a8fc11aba47eebe5bc53/src/security/pii_patterns.py
- Command line
-
hf download hf://spaces/DataEyond/Agentic-Service-Data-Eyond-Catalog@717452f69ec32394dea2a8fc11aba47eebe5bc53/src/security/pii_patterns.py
-
curl -L -o pii_patterns.py https://huggingface.co/spaces/DataEyond/Agentic-Service-Data-Eyond-Catalog/resolve/717452f69ec32394dea2a8fc11aba47eebe5bc53/src/security/pii_patterns.py
625 Bytes
| """Regex patterns and column-name heuristics for PII detection. | |
| Used by catalog/pii_detector.py at ingestion time. Default policy: | |
| when in doubt, set pii_flag=True. False positives cost nothing; false | |
| negatives leak data. | |
| """ | |
| import re | |
| PII_NAME_PATTERNS = frozenset({ | |
| "email", | |
| "phone", "mobile", "telp", "telephone", | |
| "ssn", "tin", "passport", "ktp", "nik", | |
| "name", "fullname", "first_name", "last_name", "surname", | |
| "address", "street", "zipcode", "postal", | |
| "birthdate", "dob", "birthday", | |
| }) | |
| EMAIL_REGEX = re.compile(r"^[\w.+-]+@[\w-]+\.[\w.-]+$") | |
| PHONE_REGEX = re.compile(r"^\+?[\d\s\-()]{7,}$") | |