What is OpenCC-python?
OpenCC-Python is a Python wrapper for Open Chinese Converter
Installation
To install opencc-python:
pip install opencc-python
How to use it?
You need to install opencc command tool first, if you are using Windows, the command tool is already attached in the package, you can use it right away. Following is a simple example
# -*- coding: utf8 -*-
import opencc
cc = opencc.OpenCC('t2s')
print cc.convert(u'Open Chinese Convert(OpenCC)「開放中文轉換」,是一個致力於中文簡繁轉換的項目,提供高質量詞庫和函數庫(libopencc)。')
And the output should be
Open Chinese Convert(OpenCC)「开放中文转换」,是一个致力于中文简繁转换的项目,提供高质量词库和函数库(libopencc)。
There are four build-in configurations in opencc.BUILDIN_CONFIGS,
t2s - Traditional Chinese to Simplified Chinese
s2t - Simplified Chinese to Traditional Chinese
mix2t - Mixed to Traditional Chinese
mix2s - Mixed to Simplified Chinese
To use a customized path to opencc command tool, you can pass opencc_path parameter like this
cc = opencc.OpenCC('t2s',
opencc_path='/path/to/opencc')
To use your own configuration, you should change the data_path, too
cc = opencc.OpenCC(config='/path/to/my/config',
opencc_path='/path/to/opencc',
data_path='/path/to/data/folder')
Metadata
Release files for opencc-python 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| opencc-python-0.1.zip | 944.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| opencc-python-0.1.win32.exe | Details |
Total release size: 2.1 MB
Release files / opencc-python-0.1.zip
| Download URL | opencc-python-0.1.zip |
|---|---|
| Size | 944.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f82ebf8cd62ed6377ba49ae34502c389bbaaaa25142b7eda0ffd84462153f223
|
|
BLAKE2b-256 checksum How to use checksums |
2d35afa677ced911b672e0f099856a565514a670b505f94d1150c77ce0c73a7a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / opencc-python-0.1.win32.exe
| Download URL | opencc-python-0.1.win32.exe |
|---|---|
| Size | 1.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3601a2edcaafa7ba17deb5400742bea5450859e61a39ffb105e7c8d01a1ae308
|
|
BLAKE2b-256 checksum How to use checksums |
f56802c10ef560d65e8e45271aff21f49fdb443f4233e16542ac1c1a182ffab5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for opencc-python 0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.