pii.algorithm#

Module Contents#

Classes#

API#

class pii.algorithm.PiiDeidentifier(
language: str = DEFAULT_LANGUAGE,
supported_entities: list[str] | None = None,
anonymize_action: str = 'replace',
**kwargs,
)#

Initialization

add_custom_operator(
entity: str,
operator: presidio_anonymizer.entities.OperatorConfig,
) None#
add_custom_recognizer(
recognizer: presidio_analyzer.EntityRecognizer,
) None#
analyze_text(
text: str,
entities: list[str] | None = None,
language: str = 'en',
) list[list[presidio_analyzer.RecognizerResult]]#
analyze_text_batch(
texts: list[str],
entities: list[str] | None = None,
language: str = 'en',
batch_size: int = 32,
) list[list[presidio_analyzer.RecognizerResult]]#
deidentify_text(text: str) str#
deidentify_text_batch(
texts: list[str],
batch_size: int = 32,
) list[str]#
static from_config(
config: collections.abc.Mapping[str, Any],
) pii.algorithm.PiiDeidentifier#
static from_default_config() pii.algorithm.PiiDeidentifier#
static from_yaml_file(
path: pathlib.Path | str,
) pii.algorithm.PiiDeidentifier#
list_operators() dict[str, presidio_anonymizer.entities.OperatorConfig]#
list_supported_entities() list[str]#