https://github.com/cnbeining/DeepLX-Python Python implementation of DeepLX
928
Python implementation of DeepLX, providing a FastAPI-based translation service using DeepL.
This repo only implemented the Free Endpoint.
docker run -d -p 8000:8000 -e TOKEN=your,tokens,here cnbeining/deeplx-python:latest
git clone https://github.com/cnbeining/DeepLX-Python.git
cd DeepLX-Python
docker build -t deeplx-python .
docker run -d -p 8000:8000 -e TOKEN=your,tokens,here deeplx-python
git clone https://github.com/cnbeining/DeepLX-Python.git
cd DeepLX-Python
python -m venv venv
source venv/bin/activate # On Windows, use: venv\Scripts\activate
pip install -r requirements.txt
python app/app.py
TOKEN: Comma-separated list of valid authentication tokensPROXY: Proxy URL (optional)Example:
export TOKEN=token1,token2,token3
export PROXY=http://proxy.example.com:8080
Include your token either as:
?token=your_tokenAuthorization: Bearer your_token or Authorization: DeepL-Auth-Key your_tokencurl -X POST "http://localhost:8000/translate" \
-H "Authorization: Bearer your_token" \
-H "Content-Type: application/json" \
-d '{
"text": "Hello, world!",
"source_lang": "auto",
"target_lang": "es"
}'
text: String or array of strings to translatesource_lang: Source language code (default: "auto")target_lang: Target language code (default: "en")tag_handling: Optional parameter for handling HTML/XML tags. Will be automatically detected if not set.{
"alternatives": ["translated alternatives"],
"code": 200,
"data": "translated text",
"id": 123456,
"method": "Free",
"source_lang": "detected_language",
"target_lang": "target_language"
}
This project is licensed under the GNU AGPL 3.0 License - see the LICENSE file for details.
Content type
Image
Digest
sha256:1b287bd1f…
Size
63.7 MB
Last updated
almost 2 years ago
docker pull cnbeining/deeplx-python