import pypinyin from pypinyin import Style operator = pypinyin.slug(''.join(infos.get('你好')), separator='') # nihao