Improve appliance import

This commit is contained in:
Andre Basche
2023-06-28 19:42:21 +02:00
parent 2a6b040193
commit 52837f16e3
3 changed files with 14 additions and 6 deletions

View File

@@ -29,7 +29,7 @@ def anonymize_data(data: str) -> str:
for match in re.findall(f'"{sensible}.*?":\\s"?(.+?)"?,?\\n', data):
replace = re.sub("[a-z]", "x", match)
replace = re.sub("[A-Z]", "X", replace)
replace = re.sub("\\d", "0", replace)
replace = re.sub("\\d", "1", replace)
data = data.replace(match, replace)
return data