Skip to main content

Translate chinese word to bopomofo

Project description

https://img.shields.io/travis/antfu/bopomofo.svg?style=flat-square https://img.shields.io/codecov/c/github/antfu/bopomofo.svg?style=flat-square https://img.shields.io/codacy/grade/c5ae3c7ed15f4b388218f83cda6782f9.svg?style=flat-square https://img.shields.io/pypi/v/bopomofo.svg?style=flat-square https://img.shields.io/pypi/pyversions/bopomofo.svg?style=flat-square https://img.shields.io/pypi/status/bopomofo.svg?style=flat-square https://img.shields.io/pypi/l/bopomofo.svg?style=flat-square

Translate 漢字 to ㄅㄆㄇㄈ, based on lxneng/xpinyin.

Install

pip install bopomofo

Usage

>>> from bopomofo import to_bopomofo
>>> to_bopomofo(u'注音')
'ㄓㄨˋ ㄧㄣ'

>>> to_bopomofo(u'注音', tones=False)
'ㄓㄨ ㄧㄣ'

>>> to_bopomofo(u'注音', u'、')
'ㄓㄨˋ、ㄧㄣ'

>>> bopomofo.to_bopomofo(u'注音', first_tone_symbol=True)
'ㄓㄨˋ ㄧㄣˉ'

Project details


Download files

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

Source Distribution

bopomofo-0.1.2.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

bopomofo-0.1.2-py2.py3-none-any.whl (5.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file bopomofo-0.1.2.tar.gz.

File metadata

  • Download URL: bopomofo-0.1.2.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

File hashes

Hashes for bopomofo-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5b1ff4632b0da291cd645186db45d92bb98f8c08aec6294299b5ce808cb44930
MD5 a8e4c372f4a8fd38fff29af269a2798b
BLAKE2b-256 1e8afea671eaf5fa609b275b5bc67014cf44400330466b71bc7f975dba07486b

See more details on using hashes here.

File details

Details for the file bopomofo-0.1.2-py2.py3-none-any.whl.

File metadata

  • Download URL: bopomofo-0.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

File hashes

Hashes for bopomofo-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9c41576f36ce4452f7351007254e99fbe1d172e969c3d73c5bf04727e054854d
MD5 3941aaa45f10866f5e700818dd0ac236
BLAKE2b-256 4031bc958570dc714573b7d906f9ab97d27d9a96ec523659f91fd605b8441b53

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page