pinyinlize


Namepinyinlize JSON
Version 0.2.1 PyPI version JSON
download
home_pageNone
Summarya package converts short Chinese-character strings(titles of books, articles or journals) to pinyin.
upload_time2024-08-02 01:42:31
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseNone
keywords pinyin chinese title journal book
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            readMe.md

**1 Description**: 
This is a simple and short command-line tool that converts short Chinese-character strings(titles of books, articles or journals) to pinyin. It's purpose is to facilitate generating Chinese citations or bibiliograph in the English setting. 

**2 Internal Steps** 

It first tokenizes the Chinese strings using **Jieba**, and then output the corresponding pinyin via `pypinyin`'s `lazy_pinyin`.

 - input: Chinese characters (it accepts both traditional and simplified Chinese)
 - output: pinyin strings

There are two possible outputs:  

- 1. the sentence style, which means only the first letter of the first word is capitalized. 
- 2. the headline style, in which the first letters of all tokens are capitalized. The default is the sentence style. You can use `--head` to output in the headline style


**3 usage:** 

- 1. command line:      

    `pinyinlize <Chinese_text> [--head]`

    eg: 

    `pinyinlize "清代基層地方官人事嬗遞現象之量化分析"`

    output: "Qingdai jiceng difangguan renshi shandi xianxiang zhi lianghua fenxi"

    
- 2. in python scripting

    `from pinyinlize.main_script import to_pinyin`

    The method to_pinyin has two parameters, the first the text_string, the second is True or False value. The default is True. It determines if the output is formated in sentence style.
    If sent_style is set to False, it will output headline style 
    
    eg :

    `to_pinyin("清代基層地方官人事嬗遞現象之量化分析", sent_style=False)`

    output: "Qingdai Jiceng Difangguan Renshi Shandi Xianxiang Zhi Lianghua Fenxi"

**4 Installation** 

`pip install pinyinlize`

**5 future plans**
To include a API call to Crossref and an option to output DOI or bibtex for the article or book input.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pinyinlize",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "pinyin, Chinese, title, journal, book",
    "author": null,
    "author_email": "Fei Guo <fguogufe2@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/21/62/ea6f82011a89363dece5e59d5072b22fafb03a2f12925aa47057b79a44dd/pinyinlize-0.2.1.tar.gz",
    "platform": null,
    "description": "readMe.md\n\n**1 Description**: \nThis is a simple and short command-line tool that converts short Chinese-character strings(titles of books, articles or journals) to pinyin. It's purpose is to facilitate generating Chinese citations or bibiliograph in the English setting. \n\n**2 Internal Steps** \n\nIt first tokenizes the Chinese strings using **Jieba**, and then output the corresponding pinyin via `pypinyin`'s `lazy_pinyin`.\n\n - input: Chinese characters (it accepts both traditional and simplified Chinese)\n - output: pinyin strings\n\nThere are two possible outputs:  \n\n- 1. the sentence style, which means only the first letter of the first word is capitalized. \n- 2. the headline style, in which the first letters of all tokens are capitalized. The default is the sentence style. You can use `--head` to output in the headline style\n\n\n**3 usage:** \n\n- 1. command line:      \n\n    `pinyinlize <Chinese_text> [--head]`\n\n    eg: \n\n    `pinyinlize \"\u6e05\u4ee3\u57fa\u5c64\u5730\u65b9\u5b98\u4eba\u4e8b\u5b17\u905e\u73fe\u8c61\u4e4b\u91cf\u5316\u5206\u6790\"`\n\n    output: \"Qingdai jiceng difangguan renshi shandi xianxiang zhi lianghua fenxi\"\n\n    \n- 2. in python scripting\n\n    `from pinyinlize.main_script import to_pinyin`\n\n    The method to_pinyin has two parameters, the first the text_string, the second is True or False value. The default is True. It determines if the output is formated in sentence style.\n    If sent_style is set to False, it will output headline style \n    \n    eg :\n\n    `to_pinyin(\"\u6e05\u4ee3\u57fa\u5c64\u5730\u65b9\u5b98\u4eba\u4e8b\u5b17\u905e\u73fe\u8c61\u4e4b\u91cf\u5316\u5206\u6790\", sent_style=False)`\n\n    output: \"Qingdai Jiceng Difangguan Renshi Shandi Xianxiang Zhi Lianghua Fenxi\"\n\n**4 Installation** \n\n`pip install pinyinlize`\n\n**5 future plans**\nTo include a API call to Crossref and an option to output DOI or bibtex for the article or book input.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "a package converts short Chinese-character strings(titles of books, articles or journals) to pinyin.",
    "version": "0.2.1",
    "project_urls": null,
    "split_keywords": [
        "pinyin",
        " chinese",
        " title",
        " journal",
        " book"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5f448138848e1b88eb579d548ccbfd92f430f2c5a08dfb920f41deb88324372e",
                "md5": "31c54fadd03572505c5d05d6ef12b368",
                "sha256": "dc1e9a6bb2b67222448980a2531d3c8152c531d2cedd3763762a8ef2c3c8127c"
            },
            "downloads": -1,
            "filename": "pinyinlize-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "31c54fadd03572505c5d05d6ef12b368",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4480,
            "upload_time": "2024-08-02T01:42:30",
            "upload_time_iso_8601": "2024-08-02T01:42:30.186400Z",
            "url": "https://files.pythonhosted.org/packages/5f/44/8138848e1b88eb579d548ccbfd92f430f2c5a08dfb920f41deb88324372e/pinyinlize-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2162ea6f82011a89363dece5e59d5072b22fafb03a2f12925aa47057b79a44dd",
                "md5": "419fdb455ed34b8a632844eea3fdc4cd",
                "sha256": "09aa7122fdef4027976d47bc3db14b7f939cc2ebe6f80fcaa21c52b74462431f"
            },
            "downloads": -1,
            "filename": "pinyinlize-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "419fdb455ed34b8a632844eea3fdc4cd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4122,
            "upload_time": "2024-08-02T01:42:31",
            "upload_time_iso_8601": "2024-08-02T01:42:31.764914Z",
            "url": "https://files.pythonhosted.org/packages/21/62/ea6f82011a89363dece5e59d5072b22fafb03a2f12925aa47057b79a44dd/pinyinlize-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-02 01:42:31",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pinyinlize"
}
        
Elapsed time: 0.45208s