Skip to content

Commit a643206

Browse files
committed
Update documentation to include Yandex Translate API support
- Added Yandex Translate API to the list of supported providers in README and overview documentation. - Expanded provider documentation to detail YandexProvider options, including API key and IAM token authentication. - Updated example usage for the YandexProvider in the README.
1 parent 742e935 commit a643206

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

README.rst

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Translate Tool in Python
77

88
Translate is a simple but powerful translation tool written in python with with support for
99
multiple translation providers. By now we offer integration with Microsoft Translation API,
10-
Translated MyMemory API, LibreTranslate, and DeepL's free and pro APIs
10+
Translated MyMemory API, LibreTranslate, DeepL's free and pro APIs, and Yandex Translate API
1111

1212

1313
Why Should I Use This?
@@ -152,7 +152,16 @@ To use DeepL's pro API, pass an additional parameter named pro to the Translator
152152

153153
.. code-block:: python
154154
155-
In: translator = Translator(provider='microsoft', to_lang=to_lang, secret_access_key=secret, pro=True)
155+
In: translator = Translator(provider='deepl', to_lang=to_lang, secret_access_key=secret, pro=True)
156+
157+
The Yandex Provider
158+
~~~~~~~~~~~~~~~~~~~
159+
Yandex Translate API supports both API key and IAM token authentication. To use IAM token authentication, pass the is_iam parameter set to True. You may also need to provide a folder_id for your Yandex Cloud project.
160+
161+
.. code-block:: python
162+
163+
In: translator = Translator(provider='yandex', to_lang=to_lang, secret_access_key='your_api_key', folder_id='your_folder_id')
164+
In: translator = Translator(provider='yandex', to_lang=to_lang, secret_access_key='your_iam_token', folder_id='your_folder_id', is_iam=True)
156165
157166
Documentation
158167
-------------

docs/source/overview.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Overview
22
========
33

4-
Translate is a simple but powerful translation tool written in python with with support for multiple translation providers. By now we offer integration with Microsoft Translation API, Translated MyMemory API, LibreTranslate, and DeepL's free and pro APIs.
4+
Translate is a simple but powerful translation tool written in python with with support for multiple translation providers. By now we offer integration with Microsoft Translation API, Translated MyMemory API, LibreTranslate, DeepL's free and pro APIs, and Yandex Translate API.
55

66
The biggest reason to use translate is to make translations in a simple way without the need of bigger effort and can be used as a translation tool like command line.
77

docs/source/providers.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,24 @@ for further information abount the provider:
5959

6060
https://libretranslate.com
6161
http://github.com/LibreTranslate/LibreTranslate
62+
63+
YandexProvider
64+
--------------
65+
66+
Yandex Cloud Translate API provider supporting both API key and IAM token authentication
67+
68+
``YandexProvider`` (located at ``translate.providers``) receives the following options:
69+
70+
to_lang, from_lang='autodetect', secret_access_key=None, folder_id=None, is_iam=False, base_url=None
71+
72+
* ``to_lang``: language you want to translate
73+
* ``from_lang``: Language of the text being translated (optional): as default ``autodetect``
74+
* ``secret_access_key``: Yandex API key or IAM token
75+
* ``folder_id``: Yandex Cloud folder ID (optional but may be required)
76+
* ``is_iam``: Set to True to use IAM token authentication instead of API key (default: False)
77+
* ``base_url``: Custom API endpoint URL (optional)
78+
79+
for further information about the provider:
80+
81+
https://translate.yandex.com/
82+
https://yandex.cloud/en/docs/translate/

0 commit comments

Comments
 (0)