import unicodedata from typing import Optional def normalize_string(string: str) -> Optional[str]: if string is not None: return ''.join(c for c in unicodedata.normalize('NFKD', string) if unicodedata.category(c) != 'Mn') else: return string