Examples

June 16, 2026 · View on GitHub

Runnable scripts that drive a running ovos-translate-server. Each vendor script points that vendor's own client at the matching compat router via a base-URL / endpoint override — no request rewriting — which is exactly what a DNS redirect to the server would achieve.

Run a server first

pip install ovos-translate-server ovos-translate-plugin-nllb
ovos-translate-server --tx-engine ovos-translate-plugin-nllb --port 9686

All scripts target http://localhost:9686 (edit OVOS_HOST to change it).

Scripts

ScriptDrivesInstall
native_example.pynative /translate, /detect, /status— (standard library)
deepl_example.pyofficial deepl SDK → /deeplpip install deepl
deeplx_example.pycommunity deeplx-tr client → /deeplxpip install deeplx-tr
libretranslate_example.pyofficial libretranslatepy/libretranslatepip install libretranslatepy
lingva_example.pyHTTP (no SDK exists) → /lingva— (standard library)
google_example.pyofficial google-cloud-translate/googlepip install google-cloud-translate
azure_example.pyofficial azure-ai-translation-text (1.x) → /azurepip install "azure-ai-translation-text<2"
amazon_example.pyofficial boto3 Translate → /amazonpip install boto3

DeepLX and Lingva Translate have no official Python SDK; the former is shown via the maintained community deeplx-tr client, the latter over plain HTTP.

Examples

python examples/native_example.py translate en "o meu nome é Casimiro"
python examples/deepl_example.py "hello world" DE
python examples/deeplx_example.py "hello world" en de
python examples/lingva_example.py "hello world" en de
python examples/amazon_example.py "hello world" en de