/python-jisho-cli

A simple Python 3 CLI for searching the Jisho.org Japanese language dictionary directly from the terminal.

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

MIT Pylint

python-jisho-cli

A simple Python 3 CLI for searching the Jisho.org Japanese language dictionary directly from the terminal.

Terminal example (click to show)

Terminal example

Usage

jisho-cli [-h] [-m N] [-d] [-D] [--timeout N] [--version] <one or more search keywords>

Positional arguments

  • <one or more search keyword(s)>

Optional arguments

  • -h, --helpshow this help message and exit
  • -m N, --max-results NLimit the maximum amount of results shown.
  • -d, --decompoundDecompound the lexeme, using the first lookup result from the API as base.
  • -D, --decompound_literalSame as --decompound, but use the "search keywords" argument as-is, character by character.
  • --timeoutOverride for remote API connection timeout, in seconds. If value equals zero, disables API timeout entirely.
  • --versionShow version number and exit.

Installation

One-liner install with pipx:

pipx install git+https://github.com/vakanen/python-jisho-cli.git

Upgrade with pipx:

pipx upgrade jisho-cli

Creating a config file (optional):

# Linux example

# Get the git files
git clone https://github.com/vakanen/python-jisho-cli
pushd "./python-jisho-cli/"

# Copy the config file
mkdir -p ~/.config/jisho_cli && cp ./config.yml "$_"

# Remove the git files
popd
rm -rf "./python-jisho-cli/"

Config file location

Linux

~/.config/jisho_cli/config.yml

Windows

%LOCALAPPDATA%\jisho_cli\jisho_cli\config.yml