Skip to content

demitas1/deepL_examples

Repository files navigation

DeepL Translation API Examples

This repository contains examples of how to use the DeepL Translation API with Python.

Prerequisites

  • Python 3.6 or higher
  • A DeepL API authentication key (sign up at www.deepl.com)

Installation

  1. Install the DeepL Python client library:

    pip install deepl
    
  2. 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"
      

Usage

  1. Source the authentication key file:

    source secrets.sh
    
  2. Run the example script:

    python example_free.py
    

This script demonstrates translating "Hello, world!" into various languages using the DeepL API.

Example Output

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)

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published