Skip to content

chinese-xinhua

JSON datasets of Chinese idioms, xiehouyu, words, and characters, scraped from the web.

Stars
11.7k
Forks
2.7k
Licence
MIT
Language
Python
Last update
2.9 years ago
Type
Learning resource

No commits in over a year — check for forks or alternatives before adopting.

What it is

This project is a set of JSON data files containing Chinese dictionary content: about 31,648 idioms (成语), 264,434 words (词语), 16,142 characters (汉字), and 14,032 xiehouyu (歇后语, two-part riddles). Each file has entries with fields such as the word, pinyin, and explanation. The README says the data was collected from various websites by the author, and the scraping scripts are included in the repository.

  • Load idiom.json to build an idiom-chaining game using the word and pinyin fields
  • Look up stroke count, radicals, and pinyin for characters from word.json
  • Create flashcards from the xiehouyu.json riddle and answer pairs
  • Filter idioms by their abbreviation field for a search feature

Great for

  • Developers building Chinese word games such as idiom chains
  • Researchers or students who need a structured list of Chinese idioms or characters
  • Chinese NLP experiments that need a basic lexicon with pinyin and definitions
  • Anyone who wants raw Chinese dictionary data in JSON rather than a website

Not ideal for

  • Users who need an official or verified dictionary, since the README says the data was gathered from various websites and does not state its accuracy or source-by-source licensing
  • Users who need the API, because the changelog says API functionality was taken offline in 2018
  • Users who need recent words or updates, since the last push was in December 2023 and there are no releases
Step-by-step guide: how to use chinese-xinhuaInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Clone and build from source

    Clone the repository

    git clone https://github.com/pwxcoo/chinese-xinhua.git
  2. 2

    Run it

    • Clone the repository to your computer
    • Open the data/ folder and find the JSON file you need: idiom.json, word.json, xiehouyu.json, or ci.json
    • Load the file with your language's JSON reader, for example Python's json.load
    • Read the entries, using the word or ci field as the key and explanation for definitions
  3. 3

    Get the most out of it

    • Check the README's field examples (word, pinyin, explanation, derivation, example) before writing parsers, since field sets differ between files
    • Use the abbreviation field in idiom.json for quick lookups or idiom-chain matching
    • Read the scripts/README.md in the repo to understand how the data was collected before relying on it
    • Combine the four files to link characters, words, and idioms in one project

Downloads

Strengths

  • Large amount of data across four categories, all in plain JSON
  • Simple file structure under the data/ folder that is easy to load in any language
  • Scraping scripts are included, so the collection process can be reviewed or rerun

Trade-offs

  • The README says the data was collected from various websites, and the copyright section says it will be removed if infringement is found, so reuse rights are unclear
  • No stated quality control or accuracy checks in the README
  • The API was discontinued and no newer release or version information is provided

How it compares

ProjectStarsTypeLevelUpdatedBest for
chinese-xinhua (this)11.7kLearning resourcebeginner2.9 years agoDevelopers building Chinese word games such as idiom chains
chinese-copywriting-guidelines15.8kCurated listbeginner25 days agoChinese-language writers and editors who mix Chinese with English terms or numbers
chinese-poetry54kLearning resourcebeginner5 months agoDevelopers building poetry apps, websites, or learning tools
akshare23.2kLibrarybeginner4 days agoPython users doing academic or personal research on Chinese financial markets
learn_python3_spider22.3kLearning resourcebeginner25 days agoChinese-speaking beginners who want a structured path into Python scraping
learn-python18.5kLearning resourcebeginner7 months agoBeginners who want to learn Python syntax by reading and running examples

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.