Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

A ctypes-based OpenCC converter for Chinese.

Project description

An OpenCC converter for Python.

Installation

You should install OpenCC (1.0.x) library first.

Install the python library with pip:

$ pip install OpenCC

Features

  1. Compatible with CPython and PyPy (c-types)
  2. Cython implementation (TODO)

Usage

This library has only one method:

>>> import opencc
>>> opencc.convert('乾坤一擲')
>>> opencc.convert('乾坤一掷', config='s2t.json')

Config

Convert method accepts an additional config parameter. Available configs:

hk2s.json
s2hk.json
s2t.json
s2tw.json
s2twp.json
t2s.json
tw2s.json
tw2sp.json

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for OpenCC, version 0.2
Filename, size File type Python version Upload date Hashes
Filename, size OpenCC-0.2-py2-none-any.whl (3.7 kB) File type Wheel Python version 2.7 Upload date Hashes View hashes
Filename, size OpenCC-0.2.tar.gz (6.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page