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
A program used to create accounts in bulk, still a work in progress as of now.

Discord Account Creator This project is still a work in progress. It will be published upon its full completion. About This project is still under dev

patched 8 Sep 15, 2022
Want to play What Would Rather on your Server? Invite the bot now! 😏

What is this Bot? 👀 What You Would Rather? is a Guessing game where you guess one thing. Long Description short Take this example: You typed r!rather

FSP Gang s' YT 3 Oct 18, 2021
The bot I used to win a 3d printing filament giveaway.

Instagram-CommentBot-For-Giveaways This is the bot I used to win a 3d printer filament giveaway on Instagram. Usually giveaways require you to tag oth

Esad Yusuf Atik 1 Aug 01, 2022
Spore REST API asyncio client

Spore REST API asyncio client

LEv145 16 Aug 02, 2022
Passive income method via SerpClix. Uses a bot to accept clicks.

SerpClixBotSearcher This bot allows you to get passive income from SerpClix. Each click is usually $0.10 (sometimes $0.05 if offer isnt from the US).

Jason Mei 3 Sep 01, 2021
A simple Python script using Telethon to log all (or some) messages a user or bot account can see on Telegram.

telegram-logger A simple Python script using Telethon to log all (or some) messages a user or bot account can see on Telegram. Requirements Python 3.6

Richard 13 Oct 06, 2022
Spacecrypto-bot - SpaceCrypto Bot Auto Clicker

SpaceCrypto Auto Clicker Bot Também fiz um para Luna Rush ( https://github.com/w

Walter Discher Cechinel 5 Feb 22, 2022
A simple healthcheck wrapper to monitor Kafka.

kafka-healthcheck A simple healthcheck wrapper to monitor Kafka. Kafka Healthcheck is a simple server that provides a singular API endpoint to determi

Rodrigo Nicolas Garcia 3 Oct 17, 2022
TG-Url-Uploader-Bot - Telegram RoBot to Upload Links

MW-URL-Uploader Bot Telegram RoBot to Upload Links. Features: 👉 Only Auth Users

Aadhi 3 Jun 27, 2022
Listen to the radio station from your favorite broadcast

Latest news Listen to the radio station from your favorite broadcast MyCroft Radio Skill for testing and copy at docker skill About Play regional radi

1 Dec 22, 2021
An Advanced Telegram Bot to Play Radio & Music in Voice Chat. This is Also The Source Code of The Bot Which is Being Used For Playing Radio in @AsmSafone Channel ❤️

Telegram Radio Player V3 An Advanced Telegram Bot to Play Nonstop Radio/Music/YouTube Live in Channel or Group Voice Chats. This is also the source co

SAF ONE 421 Jan 05, 2023
A python based Telegram Bot for Compressing Videos with negligible Quality change

𝕍𝕚𝕕𝕖𝕠 ℂ𝕆𝕄ℙℝ𝔼𝕊𝕊𝕆ℝ 𝔹𝕆𝕋 ᴍᴜʟᴛɪғᴜɴᴄᴛɪᴏɴ ǫᴜᴀʟɪᴛʏ ᴄᴏᴍᴘʀᴇssᴏʀ A Telegram Video CompressorBot it compress videos with negligible Quality change.

Danish 154 Dec 04, 2022
The gPodder podcast client.

___ _ _ ____ __ _| _ \___ __| |__| |___ _ _ |__ / / _` | _/ _ \/ _` / _` / -_) '_| |_ \ \__, |_| \___/\__,_\__,_\___|_| |_

gPodder and related projects 1.1k Jan 04, 2023
Crypto-trading-simulator - Cryptocurrency trading simulator using Python, Streamlit

Crypto Trading Simulator Run streamlit run main.py Dependency Python 3 streamli

Brad 12 Jul 02, 2022
A python script to download twitter space, only works on running spaces (for now).

A python script to download twitter space, only works on running spaces (for now).

279 Jan 02, 2023
Python API Client for Twitter API v2

🐍 Python Client For Twitter API v2 🚀 Why Twitter Stream ? Twitter-Stream.py a python API client for Twitter API v2 now supports FilteredStream, Samp

Twitivity 31 Nov 19, 2022
Share your files on local network just by one click.

Share Your Folder This script helps you to share any folder anywhere on your local network. it's possible to use the script on both: Windows (Click he

Mehran Seifalinia 15 Oct 23, 2022
Parse 11.000 free proxies!

Proxy Machine Description I did this project in order to boost views with the teleboost ✈️ in my Telegram channel. You can use it not only for boostin

VLDSLV 77 Jan 08, 2023
Docker image for epicseven gvg qq chatbot based on Xunbot

XUN_Langskip XUN 是一个基于 NoneBot 和 酷Q 的功能型QQ机器人,目前提供了音乐点播、音乐推荐、天气查询、RSSHub订阅、使用帮助、识图、识番、搜番、上车、磁力搜索、地震速报、计算、日语词典、翻译、自我检查,权限等级功能,由于是为了完成自己在群里的承诺,一时兴起才做的,所

Xavier Xiong 2 Jun 08, 2022
JAKYM, Just Another Konsole YouTube-Music. A command line based Youtube music player written in Python with spotify and youtube playlist support

Just Another Konsole YouTube-Music Overview I wanted to create this application so that I could use the command line to play music easily. I often pla

Mayank Jha 73 Jan 01, 2023