Implement Pinyin Input Method

Hi there,
I’m working on an app which will be deployed in different countries, including China. As I need text input from the users, I’m wondering how to implement Pinyin input method to allow typing Chinese characters. I tried a python library found on Github but the performances aren’t good enough (around 1sec to find candidates).
I’m very curious to know if anyone here has ever done this with TD or at least found a workaround, please let me know !