Skip to main content

Translate chinese chars to pinyin based on Mandarin.dat

Project description

http://img.shields.io/pypi/v/pinyin.svg?style=flat http://img.shields.io/travis/lxyu/pinyin/master.svg?style=flat http://img.shields.io/pypi/dm/pinyin.svg?style=flat

Translate chinese chars to pinyin based on Mandarin.dat

Install

$ pip install pinyin

Usage

>>> import pinyin
>>> print pinyin.get('你 好')
 hǎo

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

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

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

Note

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 Jan 4, 2016

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