deepl-cli
DeepL Translator CLI using playwright-python
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-US -s <<<'このツールは私にとって便利だ。'
This tool is useful to me.
$ deepl -T ja -s <<<'Heute ist der 22. Februar 2022.'
今日は2022年2月22日です。
$ curl https://example.com | grep -oE '>[^<]+<' | tr -d '><' | sed '1,2d' > txt
$ deepl -f txt -F en -T ja
サンプルドメイン
このドメインは、許可を得ることなくドキュメントの例で使用するためのものです。本番環境での使用は避けてください。
詳細はこちら
$ deepl -h
usage: deepl [-h] (-f PATH | -s) -F FR -T TO [-t MS] [--no-headless] [-v] [-V]
DeepL Translator CLI without API Key
options:
-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)
-F FR, --fr FR input language ('auto' to let DeepL detect it) (default: None)
-T TO, --to TO output language (default: None)
-t MS, --timeout MS timeout interval (default: 100000)
--no-headless show the browser window instead of running it headless (default: False)
-v, --verbose make output verbose (default: False)
-V, --version show program's version number and exit
valid languages of `-F` / --fr`:
{'auto', 'ht', 'ka', 'ml', 'ckb', 'mr', 'ay', 'hr', 'tt', 'ur', 'zh', 'ig', 'hu', 'gl', 'qu', 'tl', 'ln', 'vi', 'bho', 'ga', 'nl', 'scn', 'da', 'fr', 'nb', 'bn', 'mg', 'br', 'mt', 'ceb', 'ts', 'mk', 'ro', 'lmo', 'sl', 'ta', 'az', 'lt', 'sw', 'yi', 'it', 'et', 'st', 'sv', 'mn', 'he', 'gom', 'eu', 'uz', 'pam', 'ar', 'lb', 'te', 'de', 'eo', 'jv', 'ko', 'pa', 'af', 'pl', 'an', 'kmr', 'fa', 'om', 'tr', 'ru', 'tn', 'ha', 'tk', 'ace', 'pt', 'fi', 'sa', 'kk', 'mai', 'xh', 'hy', 'id', 'ps', 'bg', 'cy', 'bs', 'gu', 'el', 'pag', 'my', 'cs', 'ms', 'sr', 'is', 'ba', 'su', 'sq', 'ne', 'ky', 'zu', 'prs', 'yue', 'es', 'oc', 'en', 'sk', 'gn', 'hi', 'as', 'ja', 'ca', 'la', 'lv', 'tg', 'uk', 'mi', 'be', 'wo'}
valid languages of `-T` / `--to`:
{'ht', 'ka', 'ml', 'ckb', 'mr', 'ay', 'hr', 'tt', 'ur', 'zh', 'ig', 'hu', 'gl', 'qu', 'tl', 'ln', 'vi', 'bho', 'ga', 'nl', 'scn', 'da', 'fr', 'nb', 'bn', 'mg', 'br', 'mt', 'ceb', 'zh-Hans', 'ts', 'mk', 'ro', 'lmo', 'sl', 'ta', 'az', 'lt', 'sw', 'yi', 'it', 'et', 'st', 'sv', 'mn', 'en-US', 'he', 'gom', 'eu', 'uz', 'pam', 'ar', 'lb', 'te', 'de', 'es-419', 'eo', 'jv', 'ko', 'pa', 'af', 'pl', 'de-CH', 'an', 'fr-CA', 'pt-PT', 'kmr', 'fa', 'om', 'tr', 'ru', 'zh-Hant', 'tn', 'ha', 'tk', 'ace', 'pt', 'fi', 'sa', 'pt-BR', 'kk', 'mai', 'xh', 'hy', 'id', 'ps', 'bg', 'cy', 'bs', 'gu', 'el', 'pag', 'en-GB', 'my', 'cs', 'ms', 'sr', 'is', 'ba', 'su', 'sq', 'ne', 'ky', 'zu', 'prs', 'yue', 'es', 'oc', 'en', 'sk', 'gn', 'hi', 'as', 'ja', 'ca', 'la', 'lv', 'tg', 'uk', 'mi', 'be', 'wo'}
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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
deepl_cli-2.5.1.tar.gz
(15.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
deepl_cli-2.5.1-py3-none-any.whl
(15.7 kB
view details)
File details
Details for the file deepl_cli-2.5.1.tar.gz.
File metadata
- Download URL: deepl_cli-2.5.1.tar.gz
- Upload date:
- Size: 15.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eaf90758e3ae133307f764ff4829e0923060ba8f01fd33dfc176eff91a5f22bf
|
|
| MD5 |
3e5e4a1ef171b331f323867a4fdae39a
|
|
| BLAKE2b-256 |
f487f1f8b01c301659c908e56f628c0a94c7d763e53d237d04f88b2ab73b6d9e
|
File details
Details for the file deepl_cli-2.5.1-py3-none-any.whl.
File metadata
- Download URL: deepl_cli-2.5.1-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4a84869f438bad5f6243409b89d08309cd2d6b74e29bc6cd0723238e0c8c2df
|
|
| MD5 |
f59348a931abac4f8d58c3da5a6ac0de
|
|
| BLAKE2b-256 |
e51a9a65629cc0d6ec13a065c5bbd5f41fb89f110b980e20cb8eaa7d86c0228b
|