Hanzi Converter 繁簡轉換器 | 繁简转换器
=======================================
This tool converts between simplified and traditional Chinese Characters.
It consists of two parts:
- a command line tool: ``hanzi-convert``
- a python library: ``hanziconv``
This module supports both Python 2 and 3
.. image:: https://travis-ci.org/berniey/hanziconv.png?branch=master
:target: https://travis-ci.org/berniey/hanziconv
:alt: Build Status
.. image:: https://img.shields.io/badge/version-0.3.2-brightgreen.svg?style=plastic
:target: https://pypi.python.org/pypi/hanziconv/
:alt: Latest Version
.. image:: https://img.shields.io/badge/doc-0.3.2-brightgreen.svg?style=plastic
:target: https://pythonhosted.org/hanziconv/
:alt: Documentation
.. image:: https://img.shields.io/badge/source-latest-blue.svg?style=plastic
:target: https://github.com/berniey/hanziconv
:alt: Source Code
.. image:: https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=plastic
:target: https://raw.githubusercontent.com/berniey/hanziconv/master/LICENSE
:alt: License
Installation
------------
.. code-block:: sh
$ pip install hanziconv
Uninstallation
--------------
.. code-block:: sh
$ [sudo] pip uninstall hanziconv
Command Line Tool
-----------------
Synopsis
********
.. code-block:: sh
$ ./hanzi-convert --help
usage: hanzi-convert [-h] [-o OUTFILE] [-s] [-v] infile
Simplified and Traditional Chinese Character Conversion
Version 0.3.2 (By Bernard Yue)
Converting to Traditional Hanzi by default with no -s flag
positional arguments:
infile filename | "-", corresponds to stdin
optional arguments:
-h, --help show this help message and exit
-o OUTFILE, --output OUTFILE
filename to save output, stdout if omitted
-s, --simplified convert to simplified characters
-v, --version show program's version number and exit
Example
*******
Conversion from stdin
.. code-block:: sh
$ ./hanzi-convert -
Press Crtl-D when finished
Typing away
Now write some chinese characters
繁简转换器
^D
Typing away
Now write some chinese characters
繁簡轉換器
$
Python API
----------
Example
*******
.. code-block:: pycon
>>> from hanziconv import HanziConv
>>> print(HanziConv.toSimplified('繁簡轉換器'))
繁简转换器
>>> print(HanziConv.toTraditional('繁简转换器'))
繁簡轉換器
>>> HanziConv.same('繁簡轉換器', '繁简转换器')
True
Testing
-------
The module uses `pytest <http://pytest.org/latest/>`_. Use pip to install `pytest`.
.. code-block:: sh
$ [sudo] pip install pytest
Then checkout source code and run test as normal.
.. code-block:: sh
$ git clone https://github.com/berniey/hanziconv
$ cd hanziconv
$ python setup.py test
You are encouraged to use `virtualenv <https://virtualenv.pypa.io/en/stable/>`_
and `virtualenvwrapper <https://virtualenvwrapper.readthedocs.io/en/latest/>`_
for to avoid changing your currently operating environment.
License
-------
| This module is distributed under Apache License Version 2.0.
The character map used in this module is based on the Multi-function
Chinese Character Database developed by Chinese University of Hong Kong.
Raw data
{
"_id": null,
"home_page": "https://github.com/berniey/hanziconv",
"name": "hanziconv",
"maintainer": null,
"docs_url": "https://pythonhosted.org/hanziconv/",
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Bernard Yue",
"author_email": "hanzi.converter@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/63/71/b89cb63077fd807fe31cf7c016a06e7e579a289d8a37aa24a30282d02dd2/hanziconv-0.3.2.tar.gz",
"platform": "UNKNOWN",
"description": "Hanzi Converter \u7e41\u7c21\u8f49\u63db\u5668 | \u7e41\u7b80\u8f6c\u6362\u5668\n=======================================\n\nThis tool converts between simplified and traditional Chinese Characters.\nIt consists of two parts:\n\n - a command line tool: ``hanzi-convert``\n - a python library: ``hanziconv``\n\nThis module supports both Python 2 and 3\n\n.. image:: https://travis-ci.org/berniey/hanziconv.png?branch=master\n :target: https://travis-ci.org/berniey/hanziconv\n :alt: Build Status\n\n.. image:: https://img.shields.io/badge/version-0.3.2-brightgreen.svg?style=plastic\n :target: https://pypi.python.org/pypi/hanziconv/\n :alt: Latest Version\n\n.. image:: https://img.shields.io/badge/doc-0.3.2-brightgreen.svg?style=plastic\n :target: https://pythonhosted.org/hanziconv/\n :alt: Documentation\n\n.. image:: https://img.shields.io/badge/source-latest-blue.svg?style=plastic\n :target: https://github.com/berniey/hanziconv\n :alt: Source Code\n\n.. image:: https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=plastic\n :target: https://raw.githubusercontent.com/berniey/hanziconv/master/LICENSE\n :alt: License\n\n\nInstallation\n------------\n\n.. code-block:: sh\n\n $ pip install hanziconv\n\n\nUninstallation\n--------------\n\n.. code-block:: sh\n\n $ [sudo] pip uninstall hanziconv\n\n\nCommand Line Tool\n-----------------\n\nSynopsis\n********\n\n.. code-block:: sh\n\n $ ./hanzi-convert --help\n usage: hanzi-convert [-h] [-o OUTFILE] [-s] [-v] infile\n\n Simplified and Traditional Chinese Character Conversion\n Version 0.3.2 (By Bernard Yue)\n\n Converting to Traditional Hanzi by default with no -s flag\n\n positional arguments:\n infile filename | \"-\", corresponds to stdin\n\n optional arguments:\n -h, --help show this help message and exit\n -o OUTFILE, --output OUTFILE\n filename to save output, stdout if omitted\n -s, --simplified convert to simplified characters\n -v, --version show program's version number and exit\n\n\nExample\n*******\n\nConversion from stdin\n\n.. code-block:: sh\n\n $ ./hanzi-convert -\n Press Crtl-D when finished\n Typing away\n Now write some chinese characters\n \u7e41\u7b80\u8f6c\u6362\u5668\n ^D\n Typing away\n Now write some chinese characters\n \u7e41\u7c21\u8f49\u63db\u5668\n $\n\n\nPython API\n----------\n\nExample\n*******\n\n.. code-block:: pycon\n\n >>> from hanziconv import HanziConv\n >>> print(HanziConv.toSimplified('\u7e41\u7c21\u8f49\u63db\u5668'))\n \u7e41\u7b80\u8f6c\u6362\u5668\n >>> print(HanziConv.toTraditional('\u7e41\u7b80\u8f6c\u6362\u5668'))\n \u7e41\u7c21\u8f49\u63db\u5668\n >>> HanziConv.same('\u7e41\u7c21\u8f49\u63db\u5668', '\u7e41\u7b80\u8f6c\u6362\u5668')\n True\n\n\nTesting\n-------\nThe module uses `pytest <http://pytest.org/latest/>`_. Use pip to install `pytest`.\n\n.. code-block:: sh\n\n $ [sudo] pip install pytest\n\nThen checkout source code and run test as normal.\n\n.. code-block:: sh\n\n $ git clone https://github.com/berniey/hanziconv\n $ cd hanziconv\n $ python setup.py test\n\n\nYou are encouraged to use `virtualenv <https://virtualenv.pypa.io/en/stable/>`_\nand `virtualenvwrapper <https://virtualenvwrapper.readthedocs.io/en/latest/>`_\nfor to avoid changing your currently operating environment.\n\n\nLicense\n-------\n\n| This module is distributed under Apache License Version 2.0.\n\nThe character map used in this module is based on the Multi-function\nChinese Character Database developed by Chinese University of Hong Kong.",
"bugtrack_url": null,
"license": "Apache 2.0",
"summary": "Hanzi Converter for Traditional and Simplified Chinese",
"version": "0.3.2",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "7520ac493f4e1d16e6192e715330d3be",
"sha256": "208866da6ae305bca19eb98702b65c93bb3a803b496e4287ca740d68892fc4c4"
},
"downloads": -1,
"filename": "hanziconv-0.3.2.tar.gz",
"has_sig": false,
"md5_digest": "7520ac493f4e1d16e6192e715330d3be",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 276775,
"upload_time": "2016-09-01T05:41:15",
"upload_time_iso_8601": "2016-09-01T05:41:15.254528Z",
"url": "https://files.pythonhosted.org/packages/63/71/b89cb63077fd807fe31cf7c016a06e7e579a289d8a37aa24a30282d02dd2/hanziconv-0.3.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2016-09-01 05:41:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "berniey",
"github_project": "hanziconv",
"travis_ci": true,
"coveralls": true,
"github_actions": false,
"requirements": [],
"lcname": "hanziconv"
}