=
commited on
Commit
·
9562deb
1
Parent(s):
cf211c4
updated docs
Browse files- README.rst +28 -0
- deep_translator/__init__.py +1 -1
- docs/usage.rst +28 -1
- setup.cfg +1 -1
- setup.py +1 -1
README.rst
CHANGED
|
@@ -155,6 +155,8 @@ Imports
|
|
| 155 |
LingueeTranslator,
|
| 156 |
MyMemoryTranslator,
|
| 157 |
YandexTranslator,
|
|
|
|
|
|
|
| 158 |
single_detection,
|
| 159 |
batch_detection)
|
| 160 |
|
|
@@ -271,6 +273,32 @@ Mymemory Translator
|
|
| 271 |
|
| 272 |
translated = MyMemoryTranslator(source='en', target='fr').translate_file(path)
|
| 273 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 274 |
QCRI Translator
|
| 275 |
--------------------
|
| 276 |
|
|
|
|
| 155 |
LingueeTranslator,
|
| 156 |
MyMemoryTranslator,
|
| 157 |
YandexTranslator,
|
| 158 |
+
DeepL,
|
| 159 |
+
QCRI,
|
| 160 |
single_detection,
|
| 161 |
batch_detection)
|
| 162 |
|
|
|
|
| 273 |
|
| 274 |
translated = MyMemoryTranslator(source='en', target='fr').translate_file(path)
|
| 275 |
|
| 276 |
+
|
| 277 |
+
DeepL Translator
|
| 278 |
+
-----------------
|
| 279 |
+
|
| 280 |
+
.. note::
|
| 281 |
+
|
| 282 |
+
In order to use the DeepL translator, you need to generate an api key. Visit https://www.deepl.com/en/docs-api/
|
| 283 |
+
for more information
|
| 284 |
+
|
| 285 |
+
- Simple translation
|
| 286 |
+
|
| 287 |
+
.. code-block:: python
|
| 288 |
+
|
| 289 |
+
text = 'Keep it up. You are awesome'
|
| 290 |
+
|
| 291 |
+
translated = DeepL("your_api_key").translate(text)
|
| 292 |
+
|
| 293 |
+
- Translate batch of texts
|
| 294 |
+
|
| 295 |
+
.. code-block:: python
|
| 296 |
+
|
| 297 |
+
texts = ["hallo welt", "guten morgen"]
|
| 298 |
+
|
| 299 |
+
# the translate_sentences function is deprecated, use the translate_batch function instead
|
| 300 |
+
translated = DeepL("your_api_key").translate_batch(texts)
|
| 301 |
+
|
| 302 |
QCRI Translator
|
| 303 |
--------------------
|
| 304 |
|
deep_translator/__init__.py
CHANGED
|
@@ -12,7 +12,7 @@ from .detection import single_detection, batch_detection
|
|
| 12 |
|
| 13 |
__author__ = """Nidhal Baccouri"""
|
| 14 |
__email__ = '[email protected]'
|
| 15 |
-
__version__ = '1.2.
|
| 16 |
|
| 17 |
__all__ = [GoogleTranslator,
|
| 18 |
PonsTranslator,
|
|
|
|
| 12 |
|
| 13 |
__author__ = """Nidhal Baccouri"""
|
| 14 |
__email__ = '[email protected]'
|
| 15 |
+
__version__ = '1.2.6'
|
| 16 |
|
| 17 |
__all__ = [GoogleTranslator,
|
| 18 |
PonsTranslator,
|
docs/usage.rst
CHANGED
|
@@ -16,15 +16,17 @@ Imports
|
|
| 16 |
|
| 17 |
.. code-block:: python
|
| 18 |
|
|
|
|
| 19 |
from deep_translator import (GoogleTranslator,
|
| 20 |
PonsTranslator,
|
| 21 |
LingueeTranslator,
|
| 22 |
MyMemoryTranslator,
|
| 23 |
YandexTranslator,
|
|
|
|
|
|
|
| 24 |
single_detection,
|
| 25 |
batch_detection)
|
| 26 |
|
| 27 |
-
|
| 28 |
Check Supported Languages
|
| 29 |
---------------------------
|
| 30 |
|
|
@@ -138,6 +140,31 @@ Mymemory Translator
|
|
| 138 |
translated = MyMemoryTranslator(source='en', target='fr').translate_file(path)
|
| 139 |
|
| 140 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
QCRI Translator
|
| 142 |
--------------------
|
| 143 |
|
|
|
|
| 16 |
|
| 17 |
.. code-block:: python
|
| 18 |
|
| 19 |
+
|
| 20 |
from deep_translator import (GoogleTranslator,
|
| 21 |
PonsTranslator,
|
| 22 |
LingueeTranslator,
|
| 23 |
MyMemoryTranslator,
|
| 24 |
YandexTranslator,
|
| 25 |
+
DeepL,
|
| 26 |
+
QCRI,
|
| 27 |
single_detection,
|
| 28 |
batch_detection)
|
| 29 |
|
|
|
|
| 30 |
Check Supported Languages
|
| 31 |
---------------------------
|
| 32 |
|
|
|
|
| 140 |
translated = MyMemoryTranslator(source='en', target='fr').translate_file(path)
|
| 141 |
|
| 142 |
|
| 143 |
+
DeepL Translator
|
| 144 |
+
-----------------
|
| 145 |
+
|
| 146 |
+
.. note::
|
| 147 |
+
|
| 148 |
+
In order to use the DeepL translator, you need to generate an api key. Visit https://www.deepl.com/en/docs-api/
|
| 149 |
+
for more information
|
| 150 |
+
|
| 151 |
+
- Simple translation
|
| 152 |
+
|
| 153 |
+
.. code-block:: python
|
| 154 |
+
|
| 155 |
+
text = 'Keep it up. You are awesome'
|
| 156 |
+
|
| 157 |
+
translated = DeepL("your_api_key").translate(text)
|
| 158 |
+
|
| 159 |
+
- Translate batch of texts
|
| 160 |
+
|
| 161 |
+
.. code-block:: python
|
| 162 |
+
|
| 163 |
+
texts = ["hallo welt", "guten morgen"]
|
| 164 |
+
|
| 165 |
+
# the translate_sentences function is deprecated, use the translate_batch function instead
|
| 166 |
+
translated = DeepL("your_api_key").translate_batch(texts)
|
| 167 |
+
|
| 168 |
QCRI Translator
|
| 169 |
--------------------
|
| 170 |
|
setup.cfg
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
[bumpversion]
|
| 2 |
-
current_version = 1.2.
|
| 3 |
commit = True
|
| 4 |
tag = True
|
| 5 |
|
|
|
|
| 1 |
[bumpversion]
|
| 2 |
+
current_version = 1.2.6
|
| 3 |
commit = True
|
| 4 |
tag = True
|
| 5 |
|
setup.py
CHANGED
|
@@ -51,6 +51,6 @@ setup(
|
|
| 51 |
test_suite='tests',
|
| 52 |
tests_require=test_requirements,
|
| 53 |
url='https://github.com/nidhaloff/deep_translator',
|
| 54 |
-
version='1.2.
|
| 55 |
zip_safe=False,
|
| 56 |
)
|
|
|
|
| 51 |
test_suite='tests',
|
| 52 |
tests_require=test_requirements,
|
| 53 |
url='https://github.com/nidhaloff/deep_translator',
|
| 54 |
+
version='1.2.6',
|
| 55 |
zip_safe=False,
|
| 56 |
)
|