Module: DeeplAPI

Defined in:
lib/deepl_api.rb,
lib/deepl_api/cli.rb,
lib/deepl_api/errors.rb,
lib/deepl_api/version.rb

Overview

Requirements

You need to have a valid DeepL Pro Developer account with an associated API key. This key must be made available to the application, e. g. via environment variable:

export DEEPL_API_KEY=YOUR_KEY

Example

require "deepl_api"

deepl = DeeplAPI::DeepL.new( api_key: ENV["DEEPL_API_KEY"] )
usage = deepl.usage_information()
=> #<DeeplAPI::UsageInformation:0x00007fcbc588cc08 @character_limit=250000, @character_count=1450>

translation = deepl.translate( source_language: "DE", target_language: "EN-US", texts: ["ja"] )
=> [{"detected_source_language"=>"DE", "text"=>"yes"}]

See Also

The main API functions are documented in the DeepL class.

Defined Under Namespace

Modules: Errors Classes: CLI, DeepL, Formality, SplitSentences, UsageInformation

Constant Summary collapse

VERSION =
"0.2.1"