{"id":13460047,"url":"https://github.com/lxneng/xpinyin","last_synced_at":"2025-03-24T18:33:00.048Z","repository":{"id":915525,"uuid":"677050","full_name":"lxneng/xpinyin","owner":"lxneng","description":"Translate Chinese hanzi to pinyin (拼音) by Python, 汉字转拼音","archived":false,"fork":false,"pushed_at":"2020-12-21T07:59:45.000Z","size":203,"stargazers_count":822,"open_issues_count":8,"forks_count":178,"subscribers_count":45,"default_branch":"master","last_synced_at":"2024-10-02T02:50:51.604Z","etag":null,"topics":["chinese","hanzi","pinyin"],"latest_commit_sha":null,"homepage":"http://lxneng.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lxneng.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-05-20T13:28:54.000Z","updated_at":"2024-09-26T08:42:58.000Z","dependencies_parsed_at":"2022-07-15T05:16:48.168Z","dependency_job_id":null,"html_url":"https://github.com/lxneng/xpinyin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lxneng%2Fxpinyin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lxneng%2Fxpinyin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lxneng%2Fxpinyin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lxneng%2Fxpinyin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lxneng","download_url":"https://codeload.github.com/lxneng/xpinyin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222004117,"owners_count":16914872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chinese","hanzi","pinyin"],"created_at":"2024-07-31T10:00:34.609Z","updated_at":"2024-10-29T06:30:20.537Z","avatar_url":"https://github.com/lxneng.png","language":"Python","funding_links":[],"categories":["语言资源库","Text Processing","资源列表","Libraries/Packages","Python","Awesome Python"],"sub_categories":["python","文本处理","Python","Text Processing"],"readme":"xpinyin\n==========\n\nTranslate Chinese hanzi to pinyin (拼音) by Python, 汉字转拼音\n\n.. image:: https://github.com/lxneng/xpinyin/workflows/Tests/badge.svg\n   :target: https://github.com/lxneng/xpinyin/actions?query=workflow%3ATests\n\n.. image:: https://img.shields.io/travis/lxneng/xpinyin.svg\n    :target: https://travis-ci.org/lxneng/xpinyin\n\n.. image:: https://img.shields.io/pypi/v/xpinyin.svg\n    :target: https://pypi.python.org/pypi/xpinyin/\n\n.. image:: https://img.shields.io/pypi/dm/xpinyin.svg\n    :target: https://pypi.python.org/pypi/xpinyin/\n\n\nInstall\n----------\n\nPython version \u003e= 3.6\n\n.. code-block:: python\n\n    pip install -U xpinyin\n\n\nPython version \u003c 3.6\n\n.. code-block:: python\n\n    pip install xpinyin==0.5.7\n\n\nUsage\n-----\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from xpinyin import Pinyin\n    \u003e\u003e\u003e p = Pinyin()\n    \u003e\u003e\u003e # default splitter is `-`\n    \u003e\u003e\u003e p.get_pinyin(\"上海\")\n    'shang-hai'\n    \u003e\u003e\u003e # show tone marks\n    \u003e\u003e\u003e p.get_pinyin(\"上海\", tone_marks='marks')\n    'shàng-hǎi'\n    \u003e\u003e\u003e p.get_pinyin(\"上海\", tone_marks='numbers')\n    \u003e\u003e\u003e 'shang4-hai3'\n    \u003e\u003e\u003e # remove splitter\n    \u003e\u003e\u003e p.get_pinyin(\"上海\", '')\n    'shanghai'\n    \u003e\u003e\u003e # set splitter as whitespace\n    \u003e\u003e\u003e p.get_pinyin(\"上海\", ' ')\n    'shang hai'\n    \u003e\u003e\u003e p.get_initial(\"上\")\n    'S'\n    \u003e\u003e\u003e p.get_initials(\"上海\")\n    'S-H'\n    \u003e\u003e\u003e p.get_initials(\"上海\", '')\n    'SH'\n    \u003e\u003e\u003e p.get_initials(\"上海\", ' ')\n    'S H'\n    \u003e\u003e\u003e # get_initials with retroflex, #39\n    \u003e\u003e\u003e p.get_initials(\"上海\", splitter='-', with_retroflex=True)\n    'SH-H'\n    \u003e\u003e\u003e # New in version 0.7.0, get combinations of the multiple readings of the characters\n    \u003e\u003e\u003e p.get_pinyins('模型', splitter=' ', tone_marks='marks')\n    ['mó xíng', 'mú xíng']\n    \u003e\u003e\u003e p.get_pinyins('模样', splitter=' ', tone_marks='marks')\n    ['mó yáng', 'mó yàng', 'mó xiàng', 'mú yáng', 'mú yàng', 'mú xiàng']\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flxneng%2Fxpinyin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flxneng%2Fxpinyin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flxneng%2Fxpinyin/lists"}