You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

deepl-cli

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deepl-cli

DeepL Translator CLI without API Key

2.0.0
pipPyPI
Maintainers
1

deepl-cli

Release Package PyPI version

Code Coverage Test

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

Usage

CLI

deepl -F en -T ja -s <<<'This tool is useful for me.'
# このツールは私にとって便利だ。
deepl -F ja -T en -s <<<'このツールは私にとって便利だ。'
# This tool is useful for me.

curl https://example.com | sed -nr '/^<body>/,/<\/body>/s/<[^>]+>//gp' | tr -d \\n > txt
deepl -f txt -F en -T ja
# 例文ドメイン このドメインは、文書の例文に使用するためのものです。事前の調整や許可を得ることなく、このドメインを文献で使用することができます。   詳細はこちら
$ deepl -h
usage: deepl [-h] (-f PATH | -s) -F FR -T TO [-t MS] [-v] [-V]

DeepL Translator CLI without API Key

options:
  -h, --help        show this help message and exit
  -f, --file PATH   source text file to translate (default: None)
  -s, --stdin       read source text from stdin (default: False)
  -F, --fr FR       input language (default: None)
  -T, --to TO       output language (default: None)
  -t, --timeout MS  timeout interval (default: 5000)
  -v, --verbose     make output verbose (default: False)
  -V, --version     show program's version number and exit

valid languages of `-F` / --fr`:
{'cs', 'fr', 'ru', 'hu', 'zh', 'da', 'nl', 'es', 'lv', 'nb', 'de', 'ko', 'it', 'pt', 'pl', 'et', 'ar', 'el', 'en', 'id', 'sv', 'ro', 'ja', 'uk', 'bg', 'sk', 'fi', 'tr', 'sl', 'lt'}

valid languages of `-T` / `--to`:
{'cs', 'fr', 'ru', 'hu', 'zh', 'da', 'nl', 'en-gb', 'es', 'lv', 'nb', 'de', 'ko', 'it', 'pt', 'zh-hans', 'pl', 'et', 'pt-br', 'ar', 'el', 'en', 'id', 'sv', 'ro', 'ja', 'uk', 'bg', 'en-us', 'sk', 'zh-hant', 'pt-pt', 'fi', 'tr', 'sl', 'lt'}

Package

from deepl import DeepLCLI

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

If you use with asyncio, Use DeepLCLI.translate_async. See examples/async.py.

License

MIT

Keywords

cli

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts