DeepL Logo

Announcing the Python Client Library for the DeepL API

We’re excited to announce the release of our Python client library for the DeepL API. This is the first programming language-specific library we’ve built for the API, and our goal is to make it much easier for developers working with Python to build applications with DeepL.

Just how much easier?

Here's a text translation example. What used to be:

import requests 
result = requests.get( 
   "https://api.deepl.com/v2/translate", 
   params={ 
     "auth_key": auth_key, 
     "target_lang": target_language, 
     "text": text, 
   }, 
) 
translated_text = result.json()["translations"][0]["text"]

Is now:

import deepl 
translator = deepl.Translator(auth_key) 
result = translator.translate_text(text, target_lang=target_language) 
translated_text = result.text

We intend to support all functions of the DeepL API with the Python library, though support for new features may be added to the Python library after they're added to the API.

If that’s all you needed to hear, and you’d like to get started right away, you can find the Python client library and documentation here.

(By the way: you'll need an API authentication key to use the Python library. If you don't yet have a key, you can sign up for a Free or Pro API plan here.)

In the rest of this post, we’ll share more about the Python library project and how you can get involved.

Why start with Python?

Python was an ideal fit for our first client library. It's one of the most widely used programming languages in the world, and it’s popular amongst our API user base. It’s also a language that we have a lot of experience with at DeepL.

That said, use cases for the DeepL API are wide ranging, and there are many languages beyond Python that are important to our users. We’re exploring other client libraries we might develop in the future, and if you have any feedback on the languages that are most important to you, please get in touch and let us know.

Why open source?

The Python client library is also DeepL’s first ever open source project. We’re always looking for new ways to learn from our users and ensure that our products are solving real problems for them.

We believe that open sourcing the project is the best way to foster transparent discussion about what users need and what problems they’re running into, and we encourage you to create an issue if you have ideas or feedback.

How can I get help with the Python library?

Of course, GitHub issues isn’t the right place for every challenge you might run into while working with the Python library. If your help request includes sensitive data, please contact our support team. We’re happy to help.

Wrapping up

To recap, if you’d like to get started with DeepL’s Python client library, you can:

Thanks for reading. We’re excited to see what you build.