{"id":24866,"library":"zhconv","title":"zhconv","description":"A simple implementation of Simplified-Traditional Chinese conversion. Supports zh-Hans, zh-Hant, and regional variants like zh-tw, zh-cn, etc. Based on MediaWiki conversion tables. Current version: 1.4.3. Release cadence is low; maintained as needed.","status":"active","version":"1.4.3","language":"python","source_language":"en","source_url":"https://github.com/gumblex/zhconv","tags":["chinese","simplified","traditional","conversion","zh-cn","zh-tw","zh-hans","zh-hant"],"install":[{"cmd":"pip install zhconv","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Direct module import does not expose convert; must import the function explicitly.","wrong":"import zhconv","symbol":"convert","correct":"from zhconv import convert"}],"quickstart":{"code":"from zhconv import convert\n\n# Convert simplified Chinese to traditional\nresult = convert('我爱编程', 'zh-tw')\nprint(result)  # 我愛編程\n\n# Convert traditional to simplified\nresult2 = convert('我愛編程', 'zh-cn')\nprint(result2)  # 我爱编程","lang":"python","description":"Basic usage: convert(text, target_variant). Variants include 'zh-hans', 'zh-hant', 'zh-cn', 'zh-tw', 'zh-hk', 'zh-sg', 'zh-mo', etc."},"warnings":[{"fix":"Always specify target variant explicitly, e.g., 'zh-cn' when converting to simplified Chinese.","message":"The library does not auto-detect the source variant; you must specify the target variant. If you want to detect the source, use other libraries like opencc or langid.","severity":"gotcha","affected_versions":"all"},{"fix":"Call convert(text, 'zh-cn') then convert(result, 'zh-tw') for bidirectional conversion.","message":"Conversion is one-way per call; to convert 'back' you need to call convert again with the opposite target. The library does not maintain state.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'1.4.3':36 'base':29 'cadenc':38 'chines':9,44 'cn':27,50 'convers':10,32,47 'current':34 'etc':28 'han':14,56 'hant':17,59 'implement':4 'like':21 'low':40 'maintain':41 'mediawiki':31 'need':43 'region':19 'releas':37 'simpl':3 'simplifi':7,45 'simplified-tradit':6 'support':11 'tabl':33 'tradit':8,46 'tw':24,53 'variant':20 'version':35 'zh':13,16,23,26,49,52,55,58 'zh-cn':25,48 'zh-han':12,54 'zh-hant':15,57 'zh-tw':22,51 'zhconv':1","created_at":"2026-05-01T08:15:20.018494+00:00","updated_at":"2026-05-01T08:15:20.018494+00:00","problems":[{"fix":"Use 'from zhconv import convert' instead of 'import zhconv'.","cause":"Using import zhconv and then zhconv.convert, but the function is not a module-level attribute when imported as a module.","error":"ImportError: cannot import name 'convert' from 'zhconv'"},{"fix":"Provide target variant: convert('text', 'zh-tw')","cause":"Calling convert() without providing the target variant string.","error":"TypeError: convert() missing 1 required positional argument: 'target'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/gumblex/zhconv","docs":null,"changelog":null,"pypi":"https://pypi.org/project/zhconv/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}