Skip to main content

Translate chinese chars to pinyin based on Mandarin.dat

Project description

Translate chinese chars to pinyin based on Mandarin.dat


$ pip install pinyin


>>> import pinyin
>>> print pinyin.get('你 好')

>>> print pinyin.get('你好', format="strip", delimiter=" ")
ni hao

>>> print pinyin.get('你好', format="numerical")

>>> print pinyin.get_initial('你好')
n h


format must be one of: numerical/diacritical/strip

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pinyin-0.3.tar.gz (126.6 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page