Skip to main content

Convert English words to numbered Pinyin using CMUdict IPA.

Project description

pyenglish2pinyin

Python package to convert English words into numbered Pinyin using CMUdict-style IPA.

Install

pip install pyenglish2pinyin

Usage

from english2pinyin import english2ipa, english2pinyin, ipa2pinyin

print(english2ipa("application"))
# AE2 P L AH0 K EY1 SH AH0 N

print(english2pinyin("application"))
# ai4 po5 la5 kui1 sha5 en5

print(ipa2pinyin("S IH0 K Y UH1 R IH0 NG"))
# xi5 ke5 yu1 rui5 eng5

API

  • english2ipa(word, dict_path=None) -> str | None
  • english2pinyin(word, dict_path=None, throw_if_missing=False) -> str
  • ipa2pinyin(ipa_text) -> str

Development

pip install -e .[dev]
pytest

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

pyenglish2pinyin-0.1.0.tar.gz (922.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyenglish2pinyin-0.1.0-py3-none-any.whl (924.9 kB view details)

Uploaded Python 3

File details

Details for the file pyenglish2pinyin-0.1.0.tar.gz.

File metadata

  • Download URL: pyenglish2pinyin-0.1.0.tar.gz
  • Upload date:
  • Size: 922.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for pyenglish2pinyin-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a24e70d2fd132a1640e3a23e15fa78120dafb4557c4a1024c00ebec7216b26ff
MD5 f4d4f80f1b5e54427b48375563b4b711
BLAKE2b-256 6f0eda2e9040ae7ad1f18c05cf498496a97b3d9be5a0b5b58b116884aa396a20

See more details on using hashes here.

File details

Details for the file pyenglish2pinyin-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pyenglish2pinyin-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0426468c7dab5700c158565ad392dfdcbd9475d37ba4b44240c2cd8456df4616
MD5 965ae9d4aee41cf65f2749f2c740f3c3
BLAKE2b-256 11af86ec7b3b6010d06df5657f2eaca995131a8e4b3f544d92007e613dc1eff6

See more details on using hashes here.

Supported by

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