Anonymizor class reference¶
Anonymizers are used to anonymize data while outputting.
This module contains all classes for anonymizers:
data_migrator.anonymizors.base.BaseAnonymizer
SimpleStringAnonymizor
TextAnonymizor
ChoiceAnonymizor
Note
Also check the data_migrator.contrib
module for some country
specific anonymizers
SimpleStringAnonymizor¶
TextAnonymizor¶
ChoiceAnonymizor¶
-
class
data_migrator.anonymizors.lists.
ChoiceAnonymizor
(choices, weights=None)[source]¶ ChoiceAnonymizor returns some choices with optional probabilities
>>> ChoiceAnonymizor(['M', 'F', None], weights=[0.3, 0.3, 0.4])() 'M'
-
choices
¶ list of choices to select from
Type: list
-
weights
¶ optional list of weights
Type: list
-
BaseAnonymizor¶
-
class
data_migrator.anonymizors.base.
BaseAnonymizor
[source]¶ BaseType for anonymizers of the data-migrator.
Instantiate the anonymizer and definition and call the instantiation at translation time.
Implement the
__call__()
method to implement your specific anonymizor.