pinyin is a small library to manipulate Hanyu Pinyin.
Right now there is quite limited functionality, but you can do stuff like this:
>>> pinyin.num_to_inline('wo3 you3 25 kuai4') 'wǒ yǒu 25 kuài'
pinyin isn't on PyPi yet. For now, you can download it and run it by itself (it has no external dependencies).
$ pip install -r tests/requirements.txt $ nosetests