eggplants/deepl-cli
DeepL Translator CLI (without API Key)
deepl‑cli – Command‑line wrapper for DeepL Translator
What it is – A tiny Python package that lets you call the DeepL web translator from the terminal (or from Python code) without needing a paid DeepL API key. It drives the DeepL website with Playwright, extracts the translation, and prints it back to you.
Why it matters – Translation is a common downstream task for many AI‑powered workflows (e.g., localising documentation, preprocessing multilingual corpora, or building quick‑look‑up tools). Having a zero‑setup CLI means you can script translations in shells or CI pipelines without registering for an API.
How to get it – Install from PyPI:
pip install deepl-cli
The package pulls in playwright and will automatically download the required browser binaries on first run.
Typical command‑line usage
# Translate a short string from English to Japanese
$ deepl -F en -T ja -s <<< 'This tool is useful for me.'
このツールは私にとって役に立ちます。
# Read from a file and translate
$ deepl -f mytext.txt -F en -T fr
Key flags:
-F/--fr– source language (orautoto let DeepL detect).-T/--to– target language (many ISO‑style codes are supported).-s– read the source text from stdin.-f– translate the contents of a file.--no-headless– show the browser window (useful for debugging).-t– timeout in milliseconds.
Python API – If you prefer to embed translation in a script:
from deepl import DeepLCLI
translator = DeepLCLI('en', 'ja')
print(translator.translate('hello')) # → こんにちは
An async variant (translate_async) is also provided for asyncio code (see examples/async.py).
Limitations – Because it scrapes the public DeepL site, it is subject to the same rate‑limits and usage policies as a human user. For heavy‑duty or commercial workloads you should switch to the official DeepL API (the README points to deepl-python).
License – MIT, so you can freely modify or embed it in other tools.
Related
- Project
- Project
- Project
- Project
- Project