Python library for the DeepL language translation API.

Overview

DeepL Python Library

PyPI version Supported Python versions License: MIT

The DeepL API is a language translation API that allows other computer programs to send texts and documents to DeepL's servers and receive high-quality translations. This opens a whole universe of opportunities for developers: any translation product you can imagine can now be built on top of DeepL's best-in-class translation technology.

The DeepL Python library offers a convenient way for applications written in Python to interact with the DeepL API. We intend to support all API functions with the library, though support for new features may be added to the library after they’re added to the API.

Getting an authentication key

To use the DeepL Python Library, you'll need an API authentication key. To get a key, please create an account here. You can translate up to 500,000 characters/month for free.

Installation

The library can be installed from PyPI using pip:

pip install --upgrade deepl

If you need to modify this source code, install the dependencies using poetry:

poetry install

Requirements

The library is tested with Python versions 3.6 to 3.9.

The requests module is used to perform HTTP requests; the minimum is version 2.18.

Usage

import deepl

# Create a Translator object providing your DeepL API authentication key
translator = deepl.Translator("YOUR_AUTH_KEY")

# Translate text into a target language, in this case, French
result = translator.translate_text("Hello, world!", target_lang="FR")
print(result)  # "Bonjour, le monde !"
# Note: printing or converting the result to a string uses the output text

# Translate multiple texts into British English
result = translator.translate_text(["お元気ですか?", "¿Cómo estás?"], target_lang="EN-GB")
print(result[0].text)  # "How are you?"
print(result[0].detected_source_lang)  # "JA"
print(result[1].text)  # "How are you?"
print(result[1].detected_source_lang)  # "ES"

# Translating documents
translator.translate_document_from_filepath(
    "Instruction Manual.docx",
    "Bedienungsanleitlung.docx",
    target_lang="DE",
    formality="more"
)

# Check account usage
usage = translator.get_usage()
if usage.character.limit_exceeded:
    print("Character limit exceeded.")

# Source and target languages
for language in translator.get_source_languages():
    print(f"{language.code} ({language.name})")  # Example: "DE (German)"

num_languages = sum([language.supports_formality
                     for language in translator.get_target_languages()])
print(f"{num_languages} target languages support formality parameter")

Logging

Logging can be enabled to see the HTTP-requests sent and responses received by the library. Enable and control logging using Python's logging module, for example:

import logging
logging.basicConfig()
logging.getLogger('deepl').setLevel(logging.DEBUG)

Exceptions

All module functions may raise deepl.DeepLException or one of its subclasses. If invalid arguments are provided, they may raise the standard exceptions ValueError and TypeError.

Command Line Interface

The library can be run on the command line supporting all API functions. Use the --help option for usage information:

python3 -m deepl --help

The CLI requires your DeepL authentication key specified either as the DEEPL_AUTH_KEY environment variable, or using the --auth-key option, for example:

python3 -m deepl --auth-key=YOUR_AUTH_KEY usage

Note that the --auth-key argument must appear before the command argument. The recognized commands are:

Command Description
text translate text(s)
document translate document(s)
usage print usage information for the current billing period
languages print available languages

For example, to translate text:

python3 -m deepl --auth-key=YOUR_AUTH_KEY text --to=DE "Text to be translated."

Wrap text arguments in quotes to prevent the shell from splitting sentences into words.

Development

The test suite depends on deepl-mock. Run it in another terminal while executing the tests, using port 3000. Set the mock-server listening port using the environment variable DEEPL_MOCK_SERVER_PORT.

Execute the tests using tox.

Issues

If you experience problems using the library, or would like to request a new feature, please create an issue.

Comments
  • Add filename param to Translator#translate_document() method

    Add filename param to Translator#translate_document() method

    Thanks for making this great SDK!

    When using Translator#translate_document() method with BinaryIO input_document argument, the internal translate_document_upload call fails due to the following exception:

      File "/path-to-ptyhon/lib/python3.9/site-packages/deepl/translator.py", line 827, in translate_document
        handle = self.translate_document_upload(
      File "/path-to-ptyhon/lib/python3.9/site-packages/deepl/translator.py", line 892, in translate_document_upload
        raise ValueError(
    ValueError: filename is required if uploading file content as string or bytes
    

    This pull request resolves this issue by adding a new filename argument to translate_document() method.

    opened by seratch 8
  • DocumentTranslationException

    DocumentTranslationException

    Hi there, I've been using the Deepl python package to translate the entire PDFs. I had it running for some time already and most of the time it worked perfectly. Today, I was going through the logs and found some failed cases and the error logs I've collected. I couldn't figure out what went wrong so please provide some suggestions on how to address them:

    #1:
    Traceback (most recent call last):
      File "/opt/document_translator.py", line 528, in translate_batch_docs
        target_lang=self.target_language_code)
      File "/opt/conda/lib/python3.6/site-packages/deepl/translator.py", line 780, in translate_document_from_filepath
        raise e
      File "/opt/conda/lib/python3.6/site-packages/deepl/translator.py", line 775, in translate_document_from_filepath
        glossary=glossary,
      File "/opt/conda/lib/python3.6/site-packages/deepl/translator.py", line 839, in translate_document
        "Error occurred while translating document", handle
    deepl.exceptions.DocumentTranslationException: <super: <class 'DocumentTranslationException'>, <DocumentTranslationException object>>, document request: Document ID: B54E4E5999C915EF63AACA877843C03C, key: 2B17****
    !
    
    #2:
    Traceback (most recent call last):
      File "/opt/document_translator.py", line 528, in translate_batch_docs
        target_lang=self.target_language_code)
      File "/opt/conda/lib/python3.6/site-packages/deepl/translator.py", line 780, in translate_document_from_filepath
        raise e
      File "/opt/conda/lib/python3.6/site-packages/deepl/translator.py", line 775, in translate_document_from_filepath
        glossary=glossary,
      File "/opt/conda/lib/python3.6/site-packages/deepl/translator.py", line 817, in translate_document
        glossary=glossary,
      File "/opt/conda/lib/python3.6/site-packages/deepl/translator.py", line 876, in translate_document_upload
        self._raise_for_status(status, content, json)
      File "/opt/conda/lib/python3.6/site-packages/deepl/translator.py", line 522, in _raise_for_status
        "Too many requests, DeepL servers are currently experiencing "
    deepl.exceptions.TooManyRequestsException: Too many requests, DeepL servers are currently experiencing high load, message: Too many non-downloaded documents!
    
    #3:
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.6/site-packages/urllib3/connectionpool.py", line 445, in _make_request
        six.raise_from(e, None)
      File "<string>", line 3, in raise_from
      File "/opt/conda/lib/python3.6/site-packages/urllib3/connectionpool.py", line 440, in _make_request
        httplib_response = conn.getresponse()
      File "/opt/conda/lib/python3.6/http/client.py", line 1379, in getresponse
        response.begin()
      File "/opt/conda/lib/python3.6/http/client.py", line 311, in begin
        version, status, reason = self._read_status()
      File "/opt/conda/lib/python3.6/http/client.py", line 272, in _read_status
        line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
      File "/opt/conda/lib/python3.6/socket.py", line 586, in readinto
        return self._sock.recv_into(b)
      File "/opt/conda/lib/python3.6/ssl.py", line 1012, in recv_into
        return self.read(nbytes, buffer)
      File "/opt/conda/lib/python3.6/ssl.py", line 874, in read
        return self._sslobj.read(len, buffer)
      File "/opt/conda/lib/python3.6/ssl.py", line 631, in read
        v = self._sslobj.read(len, buffer)
    socket.timeout: The read operation timed out
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
        timeout=timeout
      File "/opt/conda/lib/python3.6/site-packages/urllib3/connectionpool.py", line 756, in urlopen
        method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
      File "/opt/conda/lib/python3.6/site-packages/urllib3/util/retry.py", line 532, in increment
        raise six.reraise(type(error), error, _stacktrace)
      File "/opt/conda/lib/python3.6/site-packages/urllib3/packages/six.py", line 735, in reraise
        raise value
      File "/opt/conda/lib/python3.6/site-packages/urllib3/connectionpool.py", line 706, in urlopen
        chunked=chunked,
      File "/opt/conda/lib/python3.6/site-packages/urllib3/connectionpool.py", line 447, in _make_request
        self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
      File "/opt/conda/lib/python3.6/site-packages/urllib3/connectionpool.py", line 337, in _raise_timeout
        self, url, "Read timed out. (read timeout=%s)" % timeout_value
    urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='api.deepl.com', port=443): Read timed out. (read timeout=10.886348485946655)
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.6/site-packages/deepl/http_client.py", line 168, in _internal_request
        request, stream=stream, timeout=timeout, **kwargs
      File "/opt/conda/lib/python3.6/site-packages/requests/sessions.py", line 655, in send
        r = adapter.send(request, **kwargs)
      File "/opt/conda/lib/python3.6/site-packages/requests/adapters.py", line 529, in send
        raise ReadTimeout(e, request=request)
    requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.deepl.com', port=443): Read timed out. (read timeout=10.886348485946655)
    
    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "/opt/document_translator.py", line 528, in translate_batch_docs
        target_lang=self.target_language_code)
      File "/opt/conda/lib/python3.6/site-packages/deepl/translator.py", line 780, in translate_document_from_filepath
        raise e
      File "/opt/conda/lib/python3.6/site-packages/deepl/translator.py", line 775, in translate_document_from_filepath
        glossary=glossary,
      File "/opt/conda/lib/python3.6/site-packages/deepl/translator.py", line 817, in translate_document
        glossary=glossary,
      File "/opt/conda/lib/python3.6/site-packages/deepl/translator.py", line 874, in translate_document_upload
        "v2/document", data=request_data, files=files
      File "/opt/conda/lib/python3.6/site-packages/deepl/translator.py", line 476, in _api_call
        **kwargs,
      File "/opt/conda/lib/python3.6/site-packages/deepl/http_client.py", line 119, in request_with_backoff
        raise exception
      File "/opt/conda/lib/python3.6/site-packages/deepl/http_client.py", line 106, in request_with_backoff
        request, stream=stream, timeout=backoff.get_timeout()
      File "/opt/conda/lib/python3.6/site-packages/deepl/http_client.py", line 184, in _internal_request
        raise ConnectionException(message, should_retry=True) from e
    deepl.exceptions.ConnectionException: Request timed out: HTTPSConnectionPool(host='api.deepl.com', port=443): Read timed out. (read timeout=10.886348485946655)
    !
    

    I'm using deepl==1.3.1 and the code I use was:

    class DocumentTranslator(object):
        def __init__(self):
            self.translator = deepl.Translator(auth_key=AUTO_TRANSLATION_KEY)
            self.target_language_code = "en-us"
    
        def translate_batch_docs(pdfs):
            for pdf in pdfs:
                translated_pdf = pdf.replace('.pdf', '_translated.pdf')
                self.translator.translate_document_from_filepath(pdf, translated_pdf, target_lang=self.target_language_code)
    
    opened by ay2456 7
  • Inappropriate Exception for queries to Ukranian

    Inappropriate Exception for queries to Ukranian

    Instead of appropriately raising DeepLException: Bad request, message: Value for 'target_lang' not supported., the request throws TooManyRequestsException: Too many requests, DeepL servers are currently experiencing high load, message: Too many requests after ~10s of sleeping. It would be much better to raise early that it is not currently supported.

    In [21]: translator.translate_text("hrdinum slava", source_lang='cs', target_lang="uk")        
    2022-08-30 12:32:47,545 deepl        INFO     Request to DeepL API method=POST url=https://api-free.deepl.com/v2/translate
    2022-08-30 12:32:47,828 deepl        INFO     Starting retry 1 for request POST https://api-free.deepl.com/v2/translate after sleeping for 0.72 seconds. 
    2022-08-30 12:32:48,711 deepl        INFO     Starting retry 2 for request POST https://api-free.deepl.com/v2/translate after sleeping for 1.39 seconds. 
    2022-08-30 12:32:50,287 deepl        INFO     Starting retry 3 for request POST https://api-free.deepl.com/v2/translate after sleeping for 2.57 seconds. 
    2022-08-30 12:32:52,963 deepl        INFO     Starting retry 4 for request POST https://api-free.deepl.com/v2/translate after sleeping for 4.27 seconds. 
    2022-08-30 12:32:57,410 deepl        INFO     Starting retry 5 for request POST https://api-free.deepl.com/v2/translate after sleeping for 4.98 seconds. 
    2022-08-30 12:33:02,605 deepl        INFO     DeepL API response status_code=429 url=https://api-free.deepl.com/v2/translate
    ---------------------------------------------------------------------------
    TooManyRequestsException                  Traceback (most recent call last)
    Input In [21], in <module>
    ----> 1 translator.translate_text("hrdinum slava", source_lang='cs', target_lang="uk")
    
    File ~/Git/Supernova/venv/lib/python3.9/site-packages/deepl/translator.py:769, in Translator.translate_text(self, text, source_lang, target_lang, split_sentences, preserve_formatting, formality, glossary, tag_handling, outline_detection, non_splitting_tags, splitting_tags, ignore_tags)
        763     request_data["ignore_tags"] = join_tags(ignore_tags)
        765 status, content, json = self._api_call(
        766     "v2/translate", data=request_data
        767 )
    --> 769 self._raise_for_status(status, content, json)
        771 translations = json.get("translations", [])
        772 output = []
    
    File ~/Git/Supernova/venv/lib/python3.9/site-packages/deepl/translator.py:560, in Translator._raise_for_status(self, status_code, content, json, glossary, downloading_document)
        558     raise DeepLException(f"Bad request{message}")
        559 elif status_code == http.HTTPStatus.TOO_MANY_REQUESTS:
    --> 560     raise TooManyRequestsException(
        561         "Too many requests, DeepL servers are currently experiencing "
        562         f"high load{message}"
        563     )
        564 elif status_code == http.HTTPStatus.SERVICE_UNAVAILABLE:
        565     if downloading_document:
    
    TooManyRequestsException: Too many requests, DeepL servers are currently experiencing high load, message: Too many requests
    
    opened by jvacek 6
  • translating xml - spaces deleted at end of text string before <b> bold

    translating xml - spaces deleted at end of text string before bold

    Hello, I am using this API to translate XML documents from Schema. Some of my text elements have bold sections and I use lxml.etree to parse and translate text and tail elements. The bold elements within text end up with the space removed in front of them. Anything I can do to keep the spaces?

    opened by vf211 6
  • Any way to get native language names from the list?

    Any way to get native language names from the list?

    For instance, in the README it shows this snippet:

    for language in translator.get_source_languages():
        print(f"{language.code} ({language.name})")  # Example: "DE (German)"
    

    It would be wonderful if the "native" translation of their language could be shown, too.

    In other words, "DE (German)" would also print "Deutsch". Most of the languages I can figure out, but not really sure what the "ZH" equivalent would be.

    I'm using the free api level, so I'm hoping that could be added to that level.

    opened by mkinney 6
  • Wrong endpoint. Use https://api.deepl.com For Deepl PRO auth key

    Wrong endpoint. Use https://api.deepl.com For Deepl PRO auth key

    Hi, When I try to use api-free key to translate text it works fine, but when I try to use Pro-key I get following error:

    translator.translate_text('abc', target_lang='en-us').text

    Traceback (most recent call last):
      File "<input>", line 1, in <module>
      File "/home/.../venv3/lib/python3.6/site-packages/deepl/translator.py", line 685, in translate_text
        self._raise_for_status(status, content, json)
      File "/home/.../venv3/lib/python3.6/site-packages/deepl/translator.py", line 501, in _raise_for_status
        f"Authorization failure, check auth_key{message}"
    deepl.exceptions.AuthorizationException: Authorization failure, check auth_key, message: Wrong endpoint. Use https://api.deepl.com
    

    Translator calls v2 API and fails with this error. But when I tried to change api_call url from v2 to v1 it worked. Is there any way to use my key with API v2 or change v2 call to v1 except for changing package source code? I'm using python3.6.14 and requests==2.25.1

    opened by ibelous 6
  • Is there anyway to check which line caused error when translating document?

    Is there anyway to check which line caused error when translating document?

    I have this error which I suspect is due to the format of a few lines in my text file. But this error is very cryptic so there is no way for me to check what caused it.

    Traceback (most recent call last): File ".\testDeepL.py", line 7, in translator.translate_document_from_filepath( File "C:\Users\Admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\deepl\translator.py", line 774, in translate_document_from_filepath raise e File "C:\Users\Admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\deepl\translator.py", line 764, in translate_document_from_filepath self.translate_document( File "C:\Users\Admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\deepl\translator.py", line 803, in translate_document handle = self.translate_document_upload( File "C:\Users\Admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\deepl\translator.py", line 858, in translate_document_upload
    self._raise_for_status(status, content, json) File "C:\Users\Admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\deepl\translator.py", line 479, in _raise_for_status raise DeepLException(f"Bad request{message}")

    opened by leminhyen2 6
  • Issue with ignore_tags parameter

    Issue with ignore_tags parameter

    Hello! Running the deepl package with anvil.works (https://pypi.org/project/deepl/1.5.0/) Example code: translation_output = translator.translate_text(translation_input target_lang="EN-US", ignore_tags=x) Getting: NameError: name 'x' is not defined

    opened by roland71 5
  • translate_text_with_glossary issue

    translate_text_with_glossary issue

    Hello,

    I'm getting this issue when I try to call with a glossary:

    flask_app | File "/usr/local/lib/python3.8/site-packages/deepl/translator.py", line 745, in translate_text_with_glossary flask_app | source_lang=glossary.source_lang, flask_app | AttributeError: 'numpy.ndarray' object has no attribute 'source_lang'

    Here is my calling code: translation = client.translate_text_with_glossary(df['SourceTokenized'].tolist(), target_lang=targetLangDeeplCode, tag_handling='html', ignore_tags='ignore', split_sentences="0", preserve_formatting="1", formality=formality, glossary=glossaryId)

    In your example you are not providing any of the optional parameters. However, I need to have these in my case.

    If it can help. The same request without the glossary is working perfectly fine: translation = client.translate_text(df['SourceTokenized'].tolist(), target_lang=targetLangDeeplCode, tag_handling='html', ignore_tags='ignore', split_sentences="0", preserve_formatting="1", formality=formality)

    Thanks for the help!

    Best regards, Samuel

    opened by SamueLacombe 5
  • Can't create an account for free-api

    Can't create an account for free-api

    Hello DeepL team, thanks for a great product!

    I want to use your API to create an iOS shortcut, but I can't find how to create an account to use free API on the page from your documentation - https://www.deepl.com/pro/select-country?cta=menu-login-signup/#developer

    I don't see my country in the list, so I can't create an account. Can you help me with that?

    opened by AntonUspehov 5
  • get_usage() does not give exact character count

    get_usage() does not give exact character count

    Hi,

    If I call translator.get_usage() before and after a translation, I get the same number of character used, an even 1 000 000. Is there a way to get the exact character count?

    opened by jaixan 4
  • Allow usage of custom CA Certificates or Disable SSL verification

    Allow usage of custom CA Certificates or Disable SSL verification

    In enterprise environments it is usual to have custom "Intermediate certificates" from different data security implementations, such as ZScaler, and will cause any requests to the DeepL engine to fail due to SSL verification error.

    Usually these certificates are retrievable from the local OS (Windows Certificates Store or Linux/Mac certs file).

    This suggestion adds a new parameter to the Translator and HttpClient classes enabling the user to pass it to the verify argument of the requests.Session object.

    Note: setting the environment variables REQUESTS_CA_BUNDLE or CURL_CA_BUNDLE does not solve the issue, as requests.Session.send and requests.Session.__init__ currently ignore OS environment variables. They are only considered in direct requests without a Session via requests.request and its dependant functions such as requests.get, requests.post, etc.

    Modifications to translator.py > Translator.__init__:

    def __init__(
            self,
            auth_key: str,
            *,
            server_url: Optional[str] = None,
            proxy: Union[Dict, str, None] = None,
            **verify_ssl:bool = True,** #<--------- Custom code added -> new 'verify_ssl' parameter --------->#
            skip_language_check: bool = False,
        ):
            if not auth_key:
                raise ValueError("auth_key must not be empty")
    
            if server_url is None:
                server_url = (
                    self._DEEPL_SERVER_URL_FREE
                    if util.auth_key_is_free_account(auth_key)
                    else self._DEEPL_SERVER_URL
                )
    
            self._server_url = server_url
            self._client = http_client.HttpClient(proxy**, verify_ssl**) #<--------- Custom code added to use local certs, when given --------->#
            self.headers = {"Authorization": f"DeepL-Auth-Key {auth_key}"}
    

    Modifications to http_client.py > HttpClient.__init__:

    def __init__(self, proxy: Union[Dict, str, None] = None**, verify_ssl:bool = True**): #<--------- Custom code added -> new 'verify' parameter --------->
            self._session = requests.Session()
            
            if proxy:
                if isinstance(proxy, str):
                    proxy = {"http": proxy, "https": proxy}
                if not isinstance(proxy, dict):
                    raise ValueError(
                        "proxy may be specified as a URL string or dictionary "
                        "containing URL strings for the http and https keys."
                    )
                self._session.proxies.update(proxy)
    
            # ------------------------------------------------------- #
            # Custom code added                                       #
            # Allows usage of Local Certificates for SSL verification #
            from os import path
            if (type(verify_ssl)==bool) or ((type(verify_ssl)==str) and path.exists(verify_ssl)):
                self._session.verify = verify_ssl
            del path
            # ------------------------------------------------------- #
    
            self._session.headers = {"User-Agent": user_agent}
            pass
    
    opened by andrefloriani 0
  • Dropped words and sentences in the translation

    Dropped words and sentences in the translation

    DeepL API will sometimes drop phrases, sentences, or words in the post translation. I am assuming this issue is already known, but am adding another data point. Feel free to close this issue if it's not needed.

    Attached in the top part of the screenshot is the API leaving off "In the early nineteenth century" in the post translation. Interestingly introducing a typo seemed to "fix" the issue, in the bottom portion of the screenshot (numerous -> numberous).

    image

    the prompt: Here on the ancient road connecting Babylon to Ecbatana, Darius the Great had a bas-relief carved on a rock face to commemorate his victory over the pseudo-Smerdis who wished to seize the Persian throne. Information about the divi-sion of the Empire into satrapies is also included in the long text of inscriptions, which are written in three languages: Akkadian, Old Persian and Elamite. In the early nineteenth century, the labours of the British Sir Henry Rawlinson resulted in the decipherment of the text, making it possible to read the numerous inscribed clay tablets that were later discovered in Nineveh.

    bug 
    opened by ELanning 3
  • [Feature Request?] Ability to set a preferred gender for outputs with gendered languages

    [Feature Request?] Ability to set a preferred gender for outputs with gendered languages

    Apologies if this issue is irrelevant.

    Is there a way to specify a preferred gender for gendered languages such as French or Spanish in a way that the translation that comes up matches it?

    For instance, with preferred gender set to feminine, from english to french: Input: "I've come to this city" Output: "Je suis venue dans cette ville" (instead of "Je suis venu dans cette ville")

    Otherwise it would be very nice if this was added. In fact, this is kind of a feature request for DeepL as a whole, not just the API, but I didn't know where else to ask. I guess this would take a certain time to implement, too.

    api change 
    opened by qexat 2
  • Get detected source language from translate_document_from_filepath

    Get detected source language from translate_document_from_filepath

    I need to get the detected source language after sending a whole PDF for translation using translate_document_from_filepath. However, I quickly went through the documentation and source code and didn't find any way to do this. Is it possible?

    api change 
    opened by ay2456 1
Releases(v1.11.0)
  • v1.11.0(Sep 26, 2022)

    Added

    • Add formality options 'prefer_less' and 'prefer_more'.

    Changed

    • Requests resulting in 503 Service Unavailable errors are now retried. Attempting to download a document before translation is completed will now wait and retry (up to 5 times by default), rather than raising an exception.
    Source code(tar.gz)
    Source code(zip)
  • v1.10.0(Sep 9, 2022)

    Added

    • New language available: Ukrainian ('uk'). Add language code constant and tests.

      Note: older library versions also support new languages, this update only adds new code constant.

    Changed

    • Add note and workaround to README about Poetry error on Ubuntu 22.04.
    Source code(tar.gz)
    Source code(zip)
  • v1.9.0(Jul 7, 2022)

  • v1.8.0(Jun 10, 2022)

    Added

    • Optional filename parameter added to Translator.translate_document(), only required if uploading string or bytes containing file content.

    Changed

    • Update contributing guidelines, we can now accept Pull Requests.

    Fixed

    • Fix GitLab CI config.
    Source code(tar.gz)
    Source code(zip)
  • v1.7.0(May 18, 2022)

    Added

    • New languages available: Indonesian ('id') and Turkish ('tr'). Add language code constants and tests.

      Note: older library versions also support the new languages, this update only adds new code constants.

    • Add limit_reached and any_limit_reached properties to Usage object returned by get_usage().

    • Add Translator.translate_document_wait_until_done() to poll translation status until translation is complete or fails.

    • Add auth_key_is_free_account() utility function.

    Changed

    • Improve readme usage examples.

    Deprecated

    • Deprecate limit_exceeded and any_limit_exceeded properties of Usage object returned by get_usage(), use limit_reached and any_limit_reached instead.
    Source code(tar.gz)
    Source code(zip)
  • v1.6.0(Apr 12, 2022)

    Added

    • Add error_message property to DocumentStatus, describing the error in case of document translation failure.

    Changed

    • Improve error message if translate_text_with_glossary is called without an instance of GlossaryInfo.
    • translate_document and translate_document_from_filepath return final DocumentStatus, allowing the number of billed characters to be queried.
    Source code(tar.gz)
    Source code(zip)
  • v1.5.1(Apr 11, 2022)

  • v1.5.0(Feb 28, 2022)

    Added

    • Add support for HTML tag handling in translate_text().

    Deprecated

    • DocumentTranslationException.document_request is deprecated, use document_handle instead.
    Source code(tar.gz)
    Source code(zip)
  • v1.4.1(Feb 4, 2022)

  • v1.4.0(Jan 19, 2022)

    Added

    • Add contribution guidelines -- currently we are unable to accept Pull Requests.
    • Add --glossary-id argument for CLI document command.

    Changed

    • Improve README.
    • Raise DocumentNotReadyException when attempting to download a document before it has been translated. Previously the base class DeepLException was thrown.

    Fixed

    • Add optional filename argument to translate_document_upload() to fix uploading file content as string or bytes.
    Source code(tar.gz)
    Source code(zip)
  • v1.3.1(Nov 16, 2021)

  • v1.3.0(Nov 15, 2021)

    Added

    • Add glossary support for document translation.
    • Add proxy support.

    Fixed

    • Fix issues with parallelized tests by changing how test glossaries are created and deleted.
    Source code(tar.gz)
    Source code(zip)
  • v1.2.1(Oct 19, 2021)

    Added

    • Add support for Python 3.10.

    Fixed

    • Fix bug that caused User-Agent header to be omitted from HTTP requests.
    • Fix glossary name prefix used in unit-tests to match git repository name.
    • Add workaround for possible issue in datetime.strptime in Python 3.6.
    Source code(tar.gz)
    Source code(zip)
  • v1.2.0(Oct 7, 2021)

    Added

    • Add Translator.get_glossary_languages() to query language pairs supported for glossaries.
    • Add constants for all supported languages codes, for example: Language.GERMAN.

    Changed

    • Internal language caching and client-side checking of language codes are removed.

    Deprecated

    • Some optional arguments related to language caching are now deprecated, and will be removed in a future version:
      • Translator(): the skip_language_check argument
      • Translator.get_source_languages() and Translator.get_target_languages(): the skip_cache argument

    Fixed

    • Fix HTTP request retries for document uploads.
    Source code(tar.gz)
    Source code(zip)
  • v1.1.3(Sep 27, 2021)

Owner
DeepL
DeepL
Telegram bot to stream videos in telegram voicechat for both groups and channels. Supports live strams, YouTube videos and telegram media.

Telegram VCVideoPlayBot An Telegram Bot By @ZauteKm To Stream Videos in Telegram Voice Chat. NOTE: Make sure you have started a VoiceChat in your Grou

Zaute 20 Oct 21, 2022
Video-Player - Telegram Music/ Video Streaming Bot Using Pytgcalls

Video Player 🔥 ᴢᴀɪᴅ ᴠᴄ ᴘʟᴀyᴇʀ ɪꜱ ᴀ ᴛᴇʟᴇɢʀᴀᴍ ᴘʀᴏᴊᴇᴄᴛ ʙᴀꜱᴇᴅ ᴏɴ ᴘʏʀᴏɢʀᴀᴍ ꜰᴏʀ ᴘʟᴀʏ

Zaid 16 Nov 30, 2022
TikTok 4L and 4C checker that doesn't count banned usernames as available

TikTok 4L and 4C checker that doesn't count banned usernames as available. Once a username is available, it will send it to your Discord Webhook.

cliphd 26 May 01, 2022
Download nitro generator that generates free nitro code that you can use for Discord

Download nitro generator that generates free nitro code that you can use for Discord, run it and wait for free nitro to come

Umut Bayraktar 154 Jan 05, 2023
A Simple Google Translate Bot By VndGroup ❤️ Made With Python

VndGroup Google Translator Heroku Deploy ❤️ Functions This Bot Can Translate 95 Languages We Can Set Custom Language Group Support Mandatory Vars [+]

Venuja Sadew 1 Oct 09, 2022
🌶️ Give real chat boosting to your discord server.

Chat-Booster Give real chat boosting to your discord server. ✅ Setup: - Add token to scrape messages on server that you whant. - Put the token in

&! Ѵιchy.#0110 36 Nov 04, 2022
A telegram bot to monitor the latest NFT price on BSC.

NFT_Monitor This is a telegram bot for monitoring price and ranking of NFT on Binance Smart Chain. Can fetch latest ranking and price in real time. .P

Niko Pang 10 Oct 09, 2022
A minimalistic library designed to provide native access to YNAB data from Python

pYNAB A minimalistic library designed to provide native access to YNAB data from Python. Install The simplest way is to install the latest version fro

Ivan Smirnov 92 Apr 06, 2022
A Telegram bot for Minecraft names

MCTelegramBot About this project This bot allows you to see data about minecraft names in Telegram, it has a few commands such as: /names - Show dropp

Kami 5 May 14, 2022
Yes, it's true :orange_heart: This repository has 346 stars.

Yes, it's true! Inspired by a similar repository from @RealPeha, but implemented using a webhook on AWS Lambda and API Gateway, so it's serverless! If

512 Jan 01, 2023
Okaeri Robot: a modular bot running on python3 with anime theme and have a lot features

OKAERI ROBOT Okaeri Robot is a modular bot running on python3 with anime theme a

Dream Garden (rey) 2 Jan 19, 2022
Install and manage Proton-GE and Luxtorpeda for Steam and Wine-GE for Lutris with this graphical user interface. Based on AUNaseef's ProtonUp, made with Python 3 and Qt 6.

ProtonUp-Qt Qt-based graphical user interface to install and manage Proton-GE installations for Steam and Wine-GE installations for Lutris. Based on A

638 Jan 02, 2023
Brute force instagram account / actonetor, 2021

Brute force instagram account / actonetor, 2021

actonetor 6 Nov 16, 2022
Telegram Group Manager Bot Written In Python Using Pyrogram.

──「𝐂𝐡𝐢𝐤𝐚 𝐅𝐮𝐣𝐢𝐰𝐚𝐫𝐚」── Telegram Group Manager Bot Written In Python Using Pyrogram. Deploy To Heroku NOTE: I'm making this note to whoever

Wahyusaputra 3 Feb 12, 2022
An API that uses NLP and AI to let you predict possible diseases and symptoms based on a prompt of what you're feeling.

Disease detection API for MediSearch An API that uses NLP and AI to let you predict possible diseases and symptoms based on a prompt of what you're fe

Sebastian Ponce 1 Jan 15, 2022
Slack->DynamDB->Some applications

slack-event-subscriptions About The Project Do you want to get simple attendance checks? If you are using Slack, participants can just react on a spec

UpstageAI 26 May 28, 2022
A community made discord bot coded in Python and running on AWS.

Pogbot Project Open Group Discord This is an open source community ran project. Join the discord for more information on how to participate. Coded in

Project Open Group 2 Jul 27, 2022
A Bot that Forwards Tweets to Telegram using Airtable as a database.

Twitter Telegram Forward A Bot that Forwards Tweets to Telegram using Airtable as a Database. Features: Handles multiple twitter and telegram channels

George Bakev 3 Dec 21, 2022
Beyonic API Python official client library simplified examples using Flask, Django and Fast API.

Beyonic API Python official client library simplified examples using Flask, Django and Fast API.

A Telegram Music Bot with proper functions written in Python with Pyrogram and Py-Tgcalls.

⭐️ Yukki Music Bot ⭐️ A Telegram Music Bot written in Python using Pyrogram and Py-Tgcalls Ready to use method A Support Group and ready-to-use runnin

Shikhar Kumar 1000 Jan 03, 2023