Skip to main content


Project description

Python 拼音

Build Pypi version Pypi downloads

将汉语转为拼音。可以用于汉字注音、排序、检索。基于 pinyinjs 开发。


To install pypinyin, simply:

$ pip install pypinyin

Basic Usage

>>> from pypinyin import pinyin
>>> import pypinyin
>>> pinyin(u'中心')
[[u'zh\u014dng'], [u'x\u012bn']]
>>> pinyin(u'中心', heteronym=True)  # 启用多音字模式
[[u'zh\u014dng', u'zh\xf2ng'], [u'x\u012bn']]
>>> pinyin(u'中心', pypinyin.STYLE_INITIALS)  # 设置拼音风格
[['zh'], ['x']]


0.1.0 (2013-09-21)

  • Initial Release

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 (604.2 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