Skip to main content

CC-CEDIT in Python

Project description

PyPI version License: CC BY-SA 4.0

CC-CEDICT in Python

To use the CC-CEDICT Chinese to English dictionary in Python.

Installation

pip install pycccedict

Example

  1. Get an entry
from pycccedict.cccedict import CcCedict

cccedict = CcCedict()
cccedict.get_entry('猫')
{
    "traditional": "貓",
    "simplified": "猫",
    "pinyin": "mao1",
    "definitions": [
        "cat",
        "CL:隻|只[zhi1]",
        "(dialect) to hide oneself",
        "(coll.) modem"
    ]
}

API

get_entry

>>> cccedict.get_entry('猫')
{
    "traditional": "貓",
    "simplified": "猫",
    "pinyin": "mao1",
    "definitions": [
        "cat",
        "CL:隻|只[zhi1]",
        "(dialect) to hide oneself",
        "(coll.) modem"
    ]
}

get_entries

>>> cccedict.get_entries()[:2]
[{'traditional': '%', 'simplified': '%', 'pinyin': 'pa1', 'definitions': ['percent (Tw)']}, {'traditional': '2019冠狀病毒病', 'simplified': '2019冠状病毒病', 'pinyin': 'er4 ling2 yi1 jiu3 guan1 zhuang4 bing4 du2 bing4', 'definitions': ['COVID-19, the coronavirus disease identified in 2019']}]

get_traditional

>>> cccedict.get_traditional('猫')
'貓'

get_simplified

>>> cccedict.get_simplified('貓')
'猫'

get_pinyin

>>> cccedict.get_pinyin('猫')
'mao1'

get_definitions

>>> cccedict.get_definitions('猫')
['cat', 'CL:隻|只[zhi1]', '(dialect) to hide oneself', '(coll.) modem']

Project details


Download files

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

Source Distribution

pycccedict-1.2.0.tar.gz (3.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycccedict-1.2.0-py3-none-any.whl (3.8 MB view details)

Uploaded Python 3

File details

Details for the file pycccedict-1.2.0.tar.gz.

File metadata

  • Download URL: pycccedict-1.2.0.tar.gz
  • Upload date:
  • Size: 3.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.10.8 Linux/6.2.0-1015-azure

File hashes

Hashes for pycccedict-1.2.0.tar.gz
Algorithm Hash digest
SHA256 4d858480ce0dba22507ffcf817bee76a2fd70b6c688ae2bff2035eecb93b9b75
MD5 d88d11ccfc6fc3b708478eeebe7d4526
BLAKE2b-256 718ce65fc057c0002a317d0f357cf737c74adf6b7e331b5d0af0e41bfe498f95

See more details on using hashes here.

File details

Details for the file pycccedict-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: pycccedict-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.10.8 Linux/6.2.0-1015-azure

File hashes

Hashes for pycccedict-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a810ca3255516a090f5f9059d6cdb156f86842f579f658a7ae7a84273bcd6326
MD5 45362939df1d7ea20fbed56ccf36b1b0
BLAKE2b-256 ffa20a1284e7dde410620f341dffc53a5f6f40f1aa188418fe096fe1411403e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page