jmquintana79
1/8/2020 - 1:08 PM

remove accents

import unicodedata

def remove_accents(input_str):
    nfkd_form = unicodedata.normalize('NFKD', input_str)
    return u"".join([c for c in nfkd_form if not unicodedata.combining(c)])
    
# test
print(remove_accents("pepón"))
import unidecode

def remove_accents(s:str)->str:
    s = unidecode.unidecode(s)
    return s