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 -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
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.4.0.tar.gz
(9.8 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.4.0-py3-none-any.whl
(10.0 kB
view details)
File details
Details for the file deepl_cli-2.4.0.tar.gz.
File metadata
- Download URL: deepl_cli-2.4.0.tar.gz
- Upload date:
- Size: 9.8 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 |
ff7646d46f7b0aff405ac8b2996443a5690a867165270aa7a9f11c8ef22a8448
|
|
| MD5 |
3af4d40aad053e8e1f2623b34ca0e671
|
|
| BLAKE2b-256 |
52cce21649a2e8cc821867cf60ec9fd86757a1d93746dace6ae45587211f5868
|
File details
Details for the file deepl_cli-2.4.0-py3-none-any.whl.
File metadata
- Download URL: deepl_cli-2.4.0-py3-none-any.whl
- Upload date:
- Size: 10.0 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 |
58e814c16ab4350b900ee7fae177f5bcf1fbe7020582aa49c04a0a6bcdede925
|
|
| MD5 |
8f808976defe412a4b800f674c7acce3
|
|
| BLAKE2b-256 |
75f3e236ca7317f033f3f24332deff4b7eeb695f38a9b969650b7b0580df939f
|