FastPII Docs
Guides

Removing Data

Completely remove detected PII from text with PrivacyGuard.remove.

PrivacyGuard.remove() deletes detected PII spans entirely.

Basic removal

from fastpii import PrivacyGuard

guard = PrivacyGuard(regions=["cz"])
text = "Kontakt: jan.novak@email.cz, RČ 8001011238, IČO 25596641"

cleaned = guard.remove(text)
print(cleaned)

Output:

Kontakt: , RČ , IČO 

Remove PII before storage

from fastpii import PrivacyGuard

guard = PrivacyGuard(regions=["cz"])
note = "Jan Novák can be contacted at jan.novak@email.cz"

stored_note = guard.remove(note)
print(stored_note)

Possible output:

 can be contacted at 

Use remove() when the sensitive data should not remain in the text at all.

On this page