tinyapps / deepl-client
Simple PHP client for the DeepL translation API.
Installs: 270
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/tinyapps/deepl-client
Requires
- php: ^7.4 || ^8.0
- guzzlehttp/guzzle: ^6.5 || ^7.0
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2025-09-29 02:29:29 UTC
README
Simple PHP DeepL API client that supports PHP 8.
Installation
composer require tinyapps/deepl-client
Usage
use TinyApps\DeepL\Translator; use TinyApps\DeepL\Options; use TinyApps\DeepL\TargetLanguage; $translator = new Translator('your_api_key'); $result = $translator->translate( text: 'Hello World', source: null, // let's DeepL auto-detect the source language target: TargetLanguage::GERMAN, preserveFormatting: false, splitSentences: Options::SPLIT_SENTENCES_DEFAULT, formality: Options::FORMALITY_DEFAULT, ); $result->getText(); // translated text $result->getDetectedSourceLanguage(); // EN
Unit Test
Run DEEPL_AUTH_KEY=[your key] composer test