Below is an example of the extend find sensitve feature. The example below returns a list of redact objects that will contain sensitve informatino. The first redact object will contain type:email text:[email protected] start:8 end:25
The start and the end are the length of the word + 1.
import scrubadub
scrubber = scrubadub.Scrubber()
text = """ Email: [email protected] IMEI: 109447782633260 MAC Address: 00-14-22-01-23-45 IPv4: 255.255.255.2 """ text = unicode(text, "utf-8") redact_list = scrubber.find_sensitive(text)
- for redact in redact_list:
- print(redact)
print(text)
*please note Not all text need to be converted to unicode, this will eventaully be removed.