This commit is contained in:
2025-08-05 15:15:36 +02:00
parent 4bd960ed05
commit 7fabb4163a
192 changed files with 14901 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
import re
def normalize_email(email: str) -> str:
# Normalize email by stripping spaces and converting to lower case
#EmailStr.validate(email) #TODO
return email.strip().lower()
def normalize_phone(phone: str) -> str:
# Normalize phone number by removing dots and spaces, and ensure it matches the pattern +<digits>
phone = phone.replace(".", "").replace(" ", "")
if not re.match(r"^\+\d+$", phone):
raise ValueError(f"Invalid phone number: {phone}")
return phone