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
Metadata
Release files for deepl-cli 2.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| deepl_cli-2.5.1.tar.gz | 15.3 kB | Without provenance | Details for deepl_cli-2.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| deepl_cli-2.5.1-py3-none-any.whl | Python 3 | none | any | Details for deepl_cli-2.5.1-py3-none-any.whl |
Total release size: 31.0 kB
Release files / deepl_cli-2.5.1.tar.gz
| Download URL | deepl_cli-2.5.1.tar.gz |
|---|---|
| Size | 15.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eaf90758e3ae133307f764ff4829e0923060ba8f01fd33dfc176eff91a5f22bf
|
|
BLAKE2b-256 checksum How to use checksums |
f487f1f8b01c301659c908e56f628c0a94c7d763e53d237d04f88b2ab73b6d9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / deepl_cli-2.5.1-py3-none-any.whl
| Download URL | deepl_cli-2.5.1-py3-none-any.whl |
|---|---|
| Size | 15.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c4a84869f438bad5f6243409b89d08309cd2d6b74e29bc6cd0723238e0c8c2df
|
|
BLAKE2b-256 checksum How to use checksums |
e51a9a65629cc0d6ec13a065c5bbd5f41fb89f110b980e20cb8eaa7d86c0228b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Security for deepl-cli 2.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.