This commit is contained in:
Andy 2024-01-24 16:30:32 -05:00 коммит произвёл GitHub
Родитель 8d08220cec
Коммит 3c7eb8909a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -1,22 +1,22 @@
# Supporting new types of PII operators
Operators are the presidio-anonymizer actions over the text.
Operators are the presidio-anonymizer actions over the text.
There are two types of operators:
There are two types of operators:
- Anonymize (hash, replace, redact, encrypt, mask)
- Deanonymize (decrypt)
Presidio anonymizer can be easily extended to support additional anonnymization and deanonymization methods.
Presidio anonymizer can be easily extended to support additional anonymization and deanonymization methods.
## Extending presidio-anonymizer for additional PII operators:
1. Under the path presidio_anonymizer/operators create new python class implementing the abstract [Operator](https://github.com/microsoft/presidio/blob/main/presidio-anonymizer/presidio_anonymizer/operators/operator.py) class
2. Implement the methods:
1. Under the path presidio_anonymizer/operators create new python class implementing the abstract [Operator](https://github.com/microsoft/presidio/blob/main/presidio-anonymizer/presidio_anonymizer/operators/operator.py) class
2. Implement the methods:
- `operate` - gets the data and returns a new text expected to replace the old one.
- `validate` - validate the parameters entered for the anonymizer exists and valid.
- `operator_name` - this method helps to automatically load the existing anonymizers.
- `operator_type` - either Anonymize or Deanonymize. Will be mapped to the proper engine.
3. Add the class to presidio_anonymizer/operators/__init__.py.
3. Add the class to presidio_anonymizer/operators/__init__.py.
4. Restart the anonymizer.
!!! note "Note"