Skip to main content

A CLI tool to learn Chinese idioms with translations

Project description

🀄 Chengyu CLI

A command-line tool to learn Chinese idioms (成语) with translations powered by DeepL.

Every time you run chengyu, you get a random idiom with its pinyin and explanation in your preferred language.

Installation

pip install chengyu

Setup

On first run, you will be guided through a quick setup:

chengyu

If you choose any language other than Chinese, you will need a free DeepL API key. Get one at: https://www.deepl.com/pro-api (choose the Free plan)

Usage

chengyu                    # Show next idiom in your default language
chengyu japanese           # Override language for this run only
chengyu --change french    # Change your default language
chengyu --add-key          # Add or update your DeepL API key
chengyu --setup            # Redo the initial setup
chengyu --help             # Show help

Supported Languages

Chinese, English, Japanese, French, German, Spanish, Italian, Korean, Portuguese, Russian, Dutch, Polish

How It Works

  • Idioms are stored locally — no internet needed to fetch them
  • Chinese output requires no API key
  • All other languages are translated via the DeepL API
  • The next idiom is preloaded in the background so display is instant

Credits

Idiom data sourced from chinese-xinhua (MIT License)

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

chengyu_cli-0.1.0.tar.gz (3.6 MB view details)

Uploaded Source

Built Distribution

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

chengyu_cli-0.1.0-py3-none-any.whl (3.7 MB view details)

Uploaded Python 3

File details

Details for the file chengyu_cli-0.1.0.tar.gz.

File metadata

  • Download URL: chengyu_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 3.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for chengyu_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e091d9afbcad1faeb918dd6901613d38f1e930e3192b1e39aa39b3519bc9f913
MD5 b542fd06bb32afa081ea0b945c2ca02f
BLAKE2b-256 2bac18532adea08023d3c9f80655a37f92d201505fc313245ffff1947f8a1a76

See more details on using hashes here.

File details

Details for the file chengyu_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: chengyu_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for chengyu_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 957789d32a32cec3d8e60150a82777986861ae2b696f664326a3308d2e163154
MD5 59a325f71cb02ad5b188ce2b4f8c2997
BLAKE2b-256 b06b0d3c0680b1d8367ca887db43e823317645999c2f6f003fd63f7fb58e806a

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