This repository contains examples of how to use the DeepL Translation API with Python.
- Python 3.6 or higher
- A DeepL API authentication key (sign up at www.deepl.com)
-
Install the DeepL Python client library:
pip install deepl
-
Set up your API authentication key:
- Create a file named
secrets.sh
in the project root. - Add your DeepL API key to the file:
export DEEPL_AUTH_KEY="your_api_key_here"
- Create a file named
-
Source the authentication key file:
source secrets.sh
-
Run the example script:
python example_free.py
This script demonstrates translating "Hello, world!" into various languages using the DeepL API.
The example_free.py
script will output translations of "Hello, world!" in:
- French (FR)
- German (DE)
- Japanese (JA)
- Simplified Chinese (ZH-HANS)
- Traditional Chinese (ZH-HANT)
- Korean (KO)
This project is licensed under the MIT License - see the LICENSE file for details.