Skip to main content

Query the pinyin of Chinese characters.

Project description

汉字拼音查询包 (Hanzi-Pinyin)

GitHub Repository License PyPI version

描述

hanzi_pinyin 是一个用于查询汉字拼音(罗马化)的包。它提供了获取简体和详细拼音表示的工具。

安装

你可以使用 pip 来安装这个包:

pip install hanzi_pinyin

使用方法

导入包

你可以按以下方式从包中导入函数:

from hanzi_pinyin import pinyin, detailed_pinyin, alls

函数

pinyin(char: str) -> List[str] | None

返回给定汉字的拼音表示列表,不带声调。

示例:

result = pinyin('汉')  # ['han']
print(result)

detailed_pinyin(char: str) -> List[str] | None

返回给定汉字的详细拼音表示列表,包括声调。

示例:

result = detailed_pinyin('汉')  # ['hàn']
print(result)

alls() -> Dict[str, List[str]]

返回整个汉字到含声调拼音映射的字典。

示例:

dict_ = alls()
print(dict_['汉'])  # ['hàn']

数据来源

本包中的数据来源为:汉文学网

爬取脚本可见 fetcher.ts

许可证

本包采用 MIT 许可证。

贡献

欢迎贡献!请提交问题或拉取请求。

作者

  • Neooier

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

hanzi_pinyin-0.2.7.tar.gz (89.2 kB view details)

Uploaded Source

Built Distribution

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

hanzi_pinyin-0.2.7-py3-none-any.whl (105.6 kB view details)

Uploaded Python 3

File details

Details for the file hanzi_pinyin-0.2.7.tar.gz.

File metadata

  • Download URL: hanzi_pinyin-0.2.7.tar.gz
  • Upload date:
  • Size: 89.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for hanzi_pinyin-0.2.7.tar.gz
Algorithm Hash digest
SHA256 d2faec1346e92989b798c56aaca923ff66b3e04c11c46fd29703b7a619f88ab2
MD5 0ea1b9040a175373b8d75bd03e2afb52
BLAKE2b-256 d66c3561e17f1015b49d4edb218917ff5b8de41ea332cd6b49bad6e918f08a75

See more details on using hashes here.

File details

Details for the file hanzi_pinyin-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: hanzi_pinyin-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 105.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for hanzi_pinyin-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 323a6ba03bd0636ef2e24bfcf83bf80d5310c215da6337290b0909933c252b3a
MD5 8db098b7d7d27a3d4286ecc4b3f4b112
BLAKE2b-256 10d8e5ce3a61757eaa6eb05fed092afe8f96f5371ce3ea9ca9cb4f5acbca60fd

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