String Mask Helper¶
Module that contains masking tools for strings.
StringMask(start_pos: int = None, end_pos: int = None, mask_after: chr = None, mask_until: chr = None, greedy: bool = False)¶
Specify a masking strategy for a string. When provided to transformers that accept masks, the mask will determine what parts of the string are redacted, encrypted, etc.
start_pos – What index position in the string to start masking after, non-inclusive.
end_pos – What index position in the string to stop masking at, inclusive.
mask_after – Scan for this character, and once observed, start masking after it, non-inclusive.
mask_until – Scan for this character, and once found, mask until it is reached, inclusive.
greedy – When using
mask_until, if True, will scan as far as possible to find the matching character. For example given the string: “this.is.the.string”, if
mask_afteris “.” and
Falsethen masking will start after “this.”. If
True, then masking will start after “this.is.the.”