OpenCC-python-reimplemented is a pure Python implementation of the Open Chinese Convert (OpenCC) library. It facilitates conversions between Traditional and Simplified Chinese, supporting character-level and phrase-level conversion, as well as handling character variants and regional idioms among Mainland China, Taiwan, and Hong Kong. The current version is 0.1.7, released in February 2023, indicating an infrequent release cadence.
pip install opencc-python-reimplementedVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the OpenCC converter with a specific conversion configuration (e.g., Simplified to Traditional Chinese) and perform text conversion. It also shows an example of Traditional to Simplified Chinese conversion.
OpenCC('s2t') # use the short code, not the full descriptionpip install opencc-python-reimplemented
Pin to a specific version in production
pip install opencc-python-reimplemented
from opencc import OpenCC
cc = OpenCC('s2t'); cc.convert('text')OpenCC('s2t')Use short codes: s2t, t2s, s2tw, s2hk, tw2s, hk2s, s2twp, tw2sp
No dependency data recorded yet.