DeepL/deepl-python

Official Python library for the DeepL language translation API.

What it solves

This library provides a straightforward way for Python developers to integrate DeepL's high-quality translation and text-improvement AI directly into their own applications. It handles the complexities of communicating with the DeepL API, including authentication, request formatting, and document processing.

How it works

After installing the library and authenticating with a DeepL API key, you initialize a DeepLClient. This client provides methods to send text or files to DeepL's servers. The library manages the entire lifecycle of these requests, such as handling document uploads, polling for completion status, and downloading the final translated files. It also supports advanced features like custom glossaries, formality adjustments, and rephrasing via the Write API.

Who it’s for

This project is for software developers building applications that require professional-grade language translation, document localization, or AI-powered text refinement.

Highlights

  • Comprehensive API Support: Access to text translation, document translation, and the Write API for rephrasing.
  • Convenience Methods: Simplifies complex workflows like document translation by automatically handling uploading, status polling, and downloading.
  • Customization: Supports glossaries for domain-specific terminology, formality control (formal/informal), and custom instructions to guide translation behavior.
  • Robust Error Handling: Provides specific exceptions for document translation issues and API errors to help with debugging and production stability.

Related

  • Project
  • Project
  • Project
  • Project
  • Project