/deepl-cli

DeepL Translator CLI (without API Key)

Primary LanguagePythonMIT LicenseMIT

deepl-cli

Release Package PyPI version

Maintainability pre-commit.ci status

image

Note: This project works without DeepL API key. With DeepL API, use DeepLcom/deepl-python

Install

pip install deepl-cli

Docker Image

docker run -it --rm ghcr.io/eggplants/deepl-cli <deepl-cli args>

Requirements

Usage

from CLI

$ deepl -h
usage: deepl [-h] (-f PATH | -s) [--fr FR] --to TO [-v]

DeepL Translator CLI without API Key

optional arguments:
  -h, --help            show this help message and exit
  -f PATH, --file PATH  source text file to translate (default: None)
  -s, --stdin           read source text from stdin (default: False)
  --fr FR               input language (default: auto)
  --to TO               output language (default: None)
  -v, --version         show program's version number and exit

valid languages of `--fr`:
{'hu', 'zh', 'ja', 'nl', 'pl', 'fr', 'ro', 'fi', 'el', 'lv', 'cs', 'et', 'sv', 'de', 'it', 'sk', 'ru', 'auto', 'es', 'sl', 'bg', 'lt', 'en', 'pt', 'da'}

valid languages of `--to`:
{'hu', 'zh', 'ja', 'nl', 'pl', 'fr', 'ro', 'fi', 'el', 'lv', 'cs', 'et', 'sv', 'de', 'it', 'sk', 'ru', 'es', 'sl', 'bg', 'lt', 'en', 'pt', 'da'}

from Package

from deepl import deepl

t = deepl.DeepLCLI("en", "ja")
t.translate("hello") #=> "こんにちわ"

License

MIT

Author

Haruna(eggplants)