All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Added the
headersoption to theTranslator,DeepLClientandDeepLAdminClientconstructors: extra HTTP headers sent with every request to the DeepL API. A header replaces the library's header of the same name, includingUser-AgentandAuthorization;Content-Type,Content-Length,Transfer-Encoding,Hostand anAcceptthe library sets for a call keep the library's value. Translation memory storage URLs get only theUser-Agent. - Added the
app_infooption, anAppInfo(app_name, app_version), to theTranslator,DeepLClientandDeepLAdminClientconstructors, the same as callingset_app_info(). - Added
NotFoundException, raised for HTTP 404 on every endpoint.GlossaryNotFoundExceptionis now its subclass. - Added
is_free_account_auth_key(), which replacesauth_key_is_free_account(). - Added the
extra_body_parametersoption tocreate_style_rule(),update_style_rule_name(),update_style_rule_configured_rules(),create_style_rule_custom_instruction()andupdate_style_rule_custom_instruction(). get_style_rule_custom_instruction(),update_style_rule_custom_instruction()anddelete_style_rule_custom_instruction()accept aCustomInstructionobject asinstruction_id, as well as an ID string.- Added the
max_retriesandtimeout_soptions to theTranslator,DeepLClientandDeepLAdminClientconstructors, to set the maximum number of retries and the minimum per-attempt timeout in seconds for each client. - Added the
style_profileoption totranslate_text()and the document translation functions (translate_document(),translate_document_from_filepath(),translate_document_upload()) to translate with a style profile, as a style profile ID orStyleProfileobject. The CLI accepts it as--style-profile-id. - Added the
DeepLAdminClientclass for the Admin API. It must be created with an admin API key and supports managing developer keys (create_developer_key(),list_developer_keys(),deactivate_developer_key(),rename_developer_key(),set_developer_key_usage_limits()) and retrieving usage analytics (get_usage_analytics(),get_custom_tag_usage_analytics()) with the result typesDeveloperKey,DeveloperKeyUsageLimits,AdminUsageReport,AdminUsageBreakdown,KeyUsage,CustomTagUsageReport,CustomTagUsageandCustomTagUsageBreakdown, and the request optionsDeveloperKeyUsageLimitsUpdate,AdminUsageGroupByandCustomTagUsageAggregateBy. The developer key methods that send a request body acceptextra_body_parameters.create_developer_key()is retried only when the request was not sent: after HTTP 429, a DNS resolution failure, a refused connection or a connect timeout.AdminUsageReport.total_usage,AdminUsageBreakdown.speech_to_speech_minutesandCustomTagUsageBreakdown.speech_to_speech_minutesareNonewhen the report does not contain them, and a response withoutusage_reportorcustom_tag_usage_reportraisesDeepLException. - Added
get_languages_for_resource()method to theDeepLClientclass to retrieve the languages supported by a resource, with per-feature support information, via the/v3/languagesendpoint. Resources are given asLanguageResourceNamevalues or strings; results areLanguageSupportobjects. Malformed responses raiseDeepLException. - Added
get_language_resources()method to theDeepLClientclass to retrieve the API resources and their features via the/v3/languages/resourcesendpoint. Results are returned asLanguageResourceandResourceFeatureobjects;needs_source_supportandneeds_target_supportareFalsewhen the API omits them. - Added
Languageconstants for the target variantsde-CH,de-DE,es-ES,fr-CA, andfr-FR. - Added the
enable_watermarkoption totranslate_document(),translate_document_upload()andtranslate_document_from_filepath(). Set it toTrueto add a "Translated by DeepL" watermark todocxandpdfoutput. - Added the API Pro usage fields to
Usage:api_key_character,speech_to_text_minutesandspeech_to_speech_minutes(asOptional[Usage.Detail]),start_timeandend_time(the billing period), andproducts, a list ofUsage.Productobjects with per-product usage. They areNonewhen the response does not contain them;productsentries that are not JSON objects are skipped. - Added the Spoken Terms API (
/v3/spoken-terms) to theDeepLClientclass:create_spoken_terms(),list_spoken_terms(),get_spoken_terms(),update_spoken_terms(),get_spoken_terms_entries(),replace_spoken_terms_list(),delete_spoken_terms()anddelete_spoken_terms_list(), with theSpokenTerms,SpokenTermsListandSpokenTermsEntriestypes.create_spoken_terms(),update_spoken_terms()andreplace_spoken_terms_list()acceptextra_body_parameters. Collection IDs are URL-encoded in the request path, terms are stripped of leading and trailing whitespace before they are validated and sent, and a malformed response raisesDeepLException. - Added the style profile API (
/v3/style_profiles) to theDeepLClientclass:list_style_profiles(),create_style_profile(),get_style_profile(),update_style_profile()anddelete_style_profile(), with theStyleProfiletype. Theglossary_ids,style_rule_idsandtranslation_memory_idsoptions ofcreate_style_profile()andupdate_style_profile()accept IDs orGlossaryInfo,MultilingualGlossaryInfo,StyleRuleInfoandTranslationMemoryInfoobjects, and both functions acceptextra_body_parameters. A style profile response that is not a JSON object, or lacks a validstyle_profile_id,name,creation_timeorupdated_time, raisesDeepLException. - Added the
TagHandlingMode(HTML,XML) andTagHandlingVersion(V1,V2) enums. Thetag_handlingandtag_handling_versionoptions oftranslate_text()accept them as well as strings. - Added
tag_handling_versiontoTextResult: the tag handling version the API used, orNonewhen the response does not contain it. translate_text()acceptssource_langandtarget_langpositionally after the text, for exampletranslate_text("Hello", None, "DE"). Keyword use is unchanged; omittingtarget_langstill raisesTypeError.- Added the
document_idproperty toDocumentStatus, read from the status response oftranslate_document_get_status()(falling back to the handle's document ID). translate_document(),translate_document_from_filepath()andtranslate_document_upload()now also acceptsource_langandtarget_langas positional arguments after the input (and output) arguments, for exampletranslate_document_upload(file, "EN", "DE"). Keyword use is unchanged.- Added the
writing_styleandextra_body_parametersoptions torephrase_text(), and theextra_body_parametersoption tocorrect_text().writing_styleandtoneaccept aWritingStyleorWritingTonemember or a string. - Added
update_multilingual_glossary()to theDeepLClientclass to rename a multilingual glossary and/or merge dictionaries into it in one request, sending only the options that are set. - Added
get_multilingual_glossary_dictionary_entries()to theDeepLClientclass, returning theMultilingualGlossaryDictionaryEntriesof one dictionary and raisingGlossaryNotFoundExceptionif the glossary has none for the language pair. - Added the
extra_body_parametersoption tocreate_multilingual_glossary(),create_multilingual_glossary_from_csv(),update_multilingual_glossary_name(),update_multilingual_glossary_dictionary(),update_multilingual_glossary_dictionary_from_csv(),replace_multilingual_glossary_dictionary()andreplace_multilingual_glossary_dictionary_from_csv(). get_multilingual_glossary()accepts aMultilingualGlossaryInfoobject, asglossary, besides a glossary ID.- Added the argument names
dictionaries(create_multilingual_glossary()),dictionary(update_multilingual_glossary_dictionary(),replace_multilingual_glossary_dictionary()),csv(the*_multilingual_glossary*_from_csv()functions) andglossary(get_multilingual_glossary()). MultilingualGlossaryInfo,MultilingualGlossaryDictionaryInfoandMultilingualGlossaryDictionaryEntriesare exported from thedeeplpackage.- Added
MultilingualGlossaryDictionaryInfo.to_json(). - Added the
content_typeandextra_body_parametersoptions toimport_translation_memory_from_filepath(), and theextra_body_parametersoption tocreate_translation_memory_import().content_typeis declared when creating the import job and sent with the upload; extra body parameters are added to the request that creates the import job and replace keys of the same name. - Added the
TranslationMemoryJobStatusenum.TranslationMemoryJob.statusandTranslationMemoryJobResult.statusnow return its members for the statusesawaiting_input,processing,completed,failedandexpired, and the plain string for any other value. Members are strings that compare equal to the API value, so existing comparisons with strings and theTranslationMemoryJobResult.STATUS_*constants keep working. - Added the
contentparameter name toupload_translation_memory_file()for the file content, replacinginput_file. Positional calls are unaffected. DocumentTranslationExceptionacceptsshould_retryandhttp_status_code.translate_document()andtranslate_document_from_filepath()copy both from the underlyingDeepLException; before they were alwaysFalseandNone.
- With
timeout_s,wait_until_translation_memory_job_done()now cuts its last sleep short; previously it could run up to 5 seconds past the timeout. import_translation_memory_from_filepath()now reads the file andexport_translation_memory_to_filepath()now checks the output path before creating the job, so theseOSErrors are raised without creating a job; previously the job was created first.translate_text()now acceptsglossaryandglossary_idswithoutsource_lang, and DeepL uses the glossary dictionary for the detected language pair; previously it raisedValueError. Document translation with a glossary still requiressource_lang.- A path in
server_urlis now kept; previously the last path segment was dropped. - HTTP 401 responses now raise
AuthorizationException; previouslyDeepLException. - Creating a
Translatornow emits aDeprecationWarning; previously it did not. - HTTP 404 responses raise
NotFoundExceptioninstead ofDeepLException(glossary functions keep raisingGlossaryNotFoundException, now a subclass ofNotFoundException). - The
User-Agentplatform information now ends withpython/<version>; previously it also included therequestsversion. - Target languages
ENandPTare now sent to the API, which translates them intoEN-USandPT-PT; previously they were rejected client-side. get_source_languages(),get_target_languages(), andget_glossary_languages()now use the/v3/languagesendpoint internally instead of the deprecated/v2/languagesand/v2/glossary-language-pairsendpoints. Public signatures and return types are unchanged, but the returned language lists may now include additional languages.- The default
chunk_sizeoftranslate_document_download()anddownload_translation_memory_export()is now 64 KiB instead of 1 byte, so downloads intooutput_fileno longer write one byte per call. The written content is unchanged; an explicitchunk_sizestill applies. DocumentStatus.statusis now typedUnion[DocumentStatus.Status, str]: a status value the API returns that this version does not know is kept as a string instead of raisingValueError. Type-checked code that readsstatus.status.valuemay need anisinstance(..., DocumentStatus.Status)guard;str(status)returns the status string in both cases.
Translatoris deprecated in favour ofDeepLClient, which supports all its functions, and will be removed in the next major version.GlossaryNotFoundExceptionis deprecated, catchNotFoundExceptioninstead. It will be removed in the next major version.auth_key_is_free_account()is deprecated, useis_free_account_auth_key(). Calling it emits aDeprecationWarning.- The module-level setting
deepl.http_client.user_agentis deprecated in favour of aUser-Agententry in theheadersoption, and will be removed in the next major version. Assigning it emits aDeprecationWarning. - Calling
translate_document_download()ordownload_translation_memory_export()withoutoutput_filenow emits aDeprecationWarning. It still returns the streamingrequests.Response; in the next major versionoutput_filewill be required and both methods will returnNone. - Passing
skip_language_checktoTranslator()orDeepLClient(), orskip_cachetoget_source_languages()orget_target_languages(), now emits aDeprecationWarning. Both parameters have no effect and will be removed in the next major version. Their defaults changed fromFalsetoNone; passingFalseexplicitly also warns. - The module-level settings
deepl.http_client.max_network_retriesanddeepl.http_client.min_connection_timeoutare deprecated in favour of themax_retriesandtimeout_sclient options, and will be removed in the next major version. They still apply to clients created without these options. Assigning either setting emits aDeprecationWarning. - The language code constants of
Language(Language.GERMAN,Language.ENGLISH_AMERICAN, ...) are deprecated and will be removed in the next major version. Pass language codes as strings, for example"de", or use the codes returned byget_source_languages()andget_target_languages(). The constants keep working and emit no warning. - The
stylekeyword ofrephrase_text()is deprecated in favour ofwriting_styleand emits aDeprecationWarning. It keeps working; if both are given,writing_styleis used. get_multilingual_glossary_entries()is deprecated, useget_multilingual_glossary_dictionary_entries().- The argument names
glossary_dicts,glossary_dict,csv_dataandglossary_idof the multilingual glossary functions are deprecated, usedictionaries,dictionary,csvandglossary. - The
input_filekeyword ofupload_translation_memory_file()is deprecated in favour ofcontentand will be removed in the next major version. Passing it emits aDeprecationWarning. SplitSentences.DEFAULTis deprecated, useSplitSentences.ALL, which it is an alias of.translate_text_with_glossary()is deprecated, usetranslate_text()with theglossaryparameter. Calling it emits aDeprecationWarning.
- A glossary CSV row without a target term now raises a
ValueErrornaming the row; previously a bareIndexError(it is still anIndexError). - A connection that is reset or breaks off while a non-streamed response body
is read is now retried like other connection failures, and raises
ConnectionExceptionwithshould_retryTrueonce retries are used up.create_developer_key()is still not retried after it. translate_document_download()now streams the translated document tooutput_filein chunks, instead of first reading the whole document into memory for the debug log.- A connection reset or timeout while
translate_document_download()ordownload_translation_memory_export()reads the downloaded file now raisesConnectionException, instead of arequestsexception. - HTTP 3xx responses that are not followed as redirects (e.g. 300, 304, or a
redirect without
Location) now raiseDeepLExceptionwithhttp_status_code, instead of being parsed as a successful response. - TLS and certificate failures, and proxy failures (including a failure to
connect to the proxy), are no longer retried and raise
ConnectionExceptionwithshould_retryFalse. - Query string values encode a space as
%20instead of+. - Fixed errors from the pre-signed translation memory upload and download URLs
reporting
should_retryas false for HTTP 429 and 5xx, and dropping the response body of a failed download from the message. - A failed
export_translation_memory_to_filepath()no longer leaves a partially written file behind. DeepLException.should_retryis nowTruefor every HTTP 5xx error. It wasFalsefor all of them except 503, although they are retried.- An error response whose
messageordetailis not a string (a number, object ornull) no longer raisesTypeError; the value is included as JSON,nullis left out. - Leading and trailing whitespace in the authentication key is removed before
it is sent and before the
:fxcheck that selects the API Free server. A key of only whitespace is rejected withValueError. - Fixed
translate_text()raisingTypeErrorwhen a translation in the response has nobilled_characters.TextResult.billed_charactersis nowNonein that case. - Fixed
translate_text()raisingIndexErrorwhen the response holds fewer translations than texts sent. It now raisesDeepLException. - Fixed
translate_document_get_status()raisingValueErrorandtranslate_document_wait_until_done()stopping when the API returns a document status this version does not know.DocumentStatus.statuskeeps such a status as a string, and polling continues. - Fixed
translate_document()andtranslate_document_from_filepath()sendingformality=defaultwhenformalitywas not set. It is now sent only when given. - Fixed
translate_document_get_status()andtranslate_document_download()not URL-encoding the document ID in the request path. - Fixed
translate_document_upload()returning an emptyDocumentHandlewhen the response lacksdocument_idordocument_key, and raisingAttributeErrorwhen the response body is not a JSON object. Both now raiseDeepLException. - Fixed the type annotation of
DocumentStatus.error_message, which is a string, not an integer. - Fixed the style rule functions inserting the style rule ID and custom
instruction ID into the request path without escaping them, so an ID
containing
/,?or#addressed a different resource. - Fixed the style rule functions raising a raw
KeyError,ValueError,TypeErrororAttributeErroron a malformedStyleRuleInfoorCustomInstructionresponse. They now raiseDeepLException. - Fixed the
DeprecationWarningmessages ofUsage.Detail.limit_exceededandUsage.any_limit_exceeded, which named the replacement instead of the deprecated property. They now read "limit_exceeded is deprecated, use limit_reached" and "any_limit_exceeded is deprecated, use any_limit_reached". - Fixed the
Language.ENGLISHandLanguage.PORTUGUESEcomments that claimed they are only usable as source languages. - Fixed
create_glossary_from_csv()failing with "Object of type bytes is not JSON serializable" when the CSV data is given as bytes or as a file opened in binary mode. - Fixed the
rephraseCLI command always failing with an unexpected keyword argument error.--show-detected-sourcenow prints the detected source language of each text. - Fixed the
translateCLI alias of thetextcommand failing with'action_translate'. - Fixed the
extra_body_parametersdocumentation, which claimed that entries do not overwrite request fields set by the library. They do, since 1.24.0. - Fixed
MultilingualGlossaryInfo.to_json()raisingTypeErrorwhen called on an instance. - Fixed
rephrase_text()andcorrect_text()failing with "Object of type ... is not JSON serializable" whentarget_langis aLanguageobject or the style or tone is aWritingStyleorWritingTonemember. The value is now sent as its string code. rephrase_text()andcorrect_text()now raiseDeepLExceptionwhen the response has noimprovementslist, fewer improvements than input texts, or an improvement withouttext. Before, this raisedIndexErrororAttributeError, or silently returned a shorter list.get_source_languages()andget_target_languages()now raiseDeepLExceptionwhen the response is not a list (they returned an empty list before) or a language in it is missing its code or name (instead of a rawKeyError,AttributeErrororTypeError). A nullfeaturesfield is treated as no features.- Glossary IDs are URL-encoded in
/v3/glossariesrequest paths, and the language pair in the query ofget_multilingual_glossary_entries()anddelete_multilingual_glossary_dictionary()is URL-encoded.delete_multilingual_glossary_dictionary()now also strips regional variants (EN-GBbecomesEN), like the other multilingual glossary functions. - A malformed multilingual glossary response raises
DeepLExceptioninstead of a rawKeyError,TypeErrororValueError. MultilingualGlossaryInfo.to_json()returns a JSON-serialisable dictionary:creation_timeas an ISO 8601 string anddictionariesas dictionaries.- Fixed the translation memory functions sending translation memory and job
IDs unencoded in the request path. IDs are now URL-encoded, so characters
such as
/,?or spaces no longer change the requested URL. - Fixed the translation memory functions raising a raw
KeyError,TypeErrororAttributeErrorwhen the API returns a malformed response. They now raiseDeepLException.list_translation_memories()also raisesDeepLExceptionfor a non-JSON response instead of returning an empty list. - Fixed
get_usage()returning aUsagewith every value invalid when the response body is not a JSON object. It now raisesDeepLException. translate_document_download()now raises errors with the API's error message. Before, a 400, 404 or 456 response raised without it, and other statuses reportedcontent: <file>.translate_document_wait_until_done()(andtranslate_document()withtimeout_s) shortens its last wait to the timeout, so it no longer runs up to 5 seconds pasttimeout_s.
1.32.0 - 2026-08-12
- Added
correct_text()method to theDeepLClientclass for fixing spelling and grammar errors in text(s) via the/v2/write/correctendpoint.
1.31.0 - 2026-08-11
- Added support for using multiple glossaries via the
glossary_idsparameter (up to 5 glossaries) intranslate_text(),translate_document(),translate_document_upload(), andtranslate_document_from_filepath(). - Added support for style rules in document translation via the
style_ruleparameter intranslate_document(),translate_document_upload(), andtranslate_document_from_filepath(). - Added support for translation memories in document translation via the
translation_memoryandtranslation_memory_thresholdparameters intranslate_document(),translate_document_upload(), andtranslate_document_from_filepath(). - Added
--glossary-idsCLI argument for thetextanddocumentcommands, allowing up to 5 glossaries to be used per translation. - Added
--style-id,--translation-memory-id, and--translation-memory-thresholdCLI arguments to thedocumentcommand. - Added support for the translation memory management APIs:
get_translation_memory(),list_translation_memory_segments(),delete_translation_memory(),create_translation_memory_import(),upload_translation_memory_file(),create_translation_memory_export(),get_translation_memory_job(),wait_until_translation_memory_job_done(), anddownload_translation_memory_export(), along with theimport_translation_memory_from_filepath()andexport_translation_memory_to_filepath()convenience functions that create the job, transfer the TMX file, and wait for the job to finish. Because the API detects the file upload asynchronously, an import job keeps reportingawaiting_inputfor a while after the upload; the wait loop polls through that status, so passtimeout_sto bound the wait. - Added the
TranslationMemorySegments,TranslationMemorySegment,TranslationMemoryTargetSegment,TranslationMemoryImport,TranslationMemoryExport,TranslationMemoryJob, andTranslationMemoryJobResulttypes. - Added
creation_timeandupdated_timeproperties toTranslationMemoryInfo. - Added the
translation-memoryCLI command with thelist,get,segments,import,export,job, anddeletesubcommands.
1.30.0 - 2026-04-09
- Added support for translation memories in text translation via
translation_memoryandtranslation_memory_thresholdparameters intranslate_text(). - Added
list_translation_memories()method to theDeepLClientclass for listing available translation memories. - Added
--translation-memory-idand--translation-memory-thresholdCLI arguments.
- Fixed "gitlab release" CI job to explicitly set the release-cli image, avoiding issues with missing
$HOMEfrom the global image.
1.29.0 - 2026-03-26
- Added new language constants from January 2026 API release of 81 new languages.
- Added support for style rules CRUD endpoints in the
DeepLClientclass:create_style_rule(),get_style_rule(),update_style_rule_name(),update_style_rule_configured_rules(), anddelete_style_rule(). - Added support for style rule custom instruction CRUD endpoints in the
DeepLClientclass:create_style_rule_custom_instruction(),get_style_rule_custom_instruction(),update_style_rule_custom_instruction(), anddelete_style_rule_custom_instruction(). Please refer to the README for usage instructions.
- Updated formality tests to accept either formal or informal output when using default formality, since the default formality is automatic.
1.28.0 - 2026-02-05
- Updated three tests to be less flakey and reflect new behavior regarding the model type.
- Improved
NotFoundExceptionerror message by removing the misleading "check server_url" suggestion.
- Fixed a bug where translating with style rules would sometimes incorrectly result in a "target_lang must match style rule language" error
- Updated dependencies to fix CVE-2025-66418 and CVE-2025-66471
1.27.0 - 2025-12-10
- Added
tag_handling_versionparameter totranslate_text()to specify which version of the tag handling algorithm to use. Options arev1andv2. - Added an example CLI script for realtime audio translation using DeepL's Voice API.
1.26.0 - 2025-12-03
- Added
custom_instructionsparameter totranslate_text()to customize translation behavior with up to 10 instructions (max 300 characters each). Only supported for target languages:de,en,es,fr,it,ja,ko,zhand their variants. Note: using thecustom_instructionsparameter will use thequality_optimizedmodel type as the default. Requests combiningcustom_instructionsand thelatency_optimizedmodel type will be rejected.
- Fixed the cleanup of multilingual glossaries in the test suite where glossaries were not properly deleted after the test execution
1.25.0 - 2025-11-12
- Added support for the
GET /v3/style_rulesendpoint in the client library, the implementation can be found in theDeepLClientclass. Please refer to the README for usage instructions - Added
style_idoption totranslate_text()which allows text translation with style rules.
1.24.0 - 2025-11-04
extra_body_parameterswill now overwrite already set HTTP parameters
1.23.0 - 2025-09-30
- Added feature to add arbitrary body parameters in
translate_text
- Dropped support for Python 3.8 and older.
- Updated
requestsminimum version to 2.32.4 to resolve security advisories CVE-2024-47081 and CVE-2024-35195.
1.22.0 - 2025-04-30
- Added support for the /v3 Glossary APIs in the client library while providing backwards compatability for the previous /v2 Glossary endpoints. Please refer to the README for usage instructions.
1.21.1 - 2025-03-12
- (beta) optional parameter to specify timeout for document translation calls
1.21.0 - 2025-01-15
- Added support for the Write API in the client library, the implementation
can be found in the
DeepLClientclass. Please refer to the README for usage instructions.
- The main functionality of the library is now also exposed via the
DeepLClientclass. Please change your code to use this over theTranslatorclass whenever convenient.
1.20.0 - 2024-11-15
- Added
model_typeoption totranslate_text()to use models with higher translation quality (available for some language pairs), or better latency. Options are'quality_optimized','latency_optimized', and'prefer_quality_optimized' - Added the
model_type_usedfield totranslate_text()response, that indicates the translation model used when themodel_typeoption is specified.
1.19.1 - 2024-09-17
- Fixed typing issues, black-formatting and a test case failure.
1.19.0 - 2024-09-17
- Added
billed_charactersto response fromtranslate_text().
1.18.0 - 2024-04-26
-
New language available: Arabic (
'ar'). Add language code constants and tests. Arabic is currently supported only for text translation; document translation support for Arabic is coming soon.Note: older library versions also support the new language, this update only adds new code constants.
-
Added a section in the readme on how to configure retry options in
http_client.py
1.17.0 - 2024-02-06
- Added
output_formatparameter for document upload function, that indicates the file extension of the desired file format for the translated document. - Added basic usage example of the library
- Fixed typechecking errors when using
mypy'sstrictmode- Thanks to derlikh-smart and vad for the report in #82
1.16.1 - 2023-11-07
- Fixed typo in error message when no auth key is provided.
- Removed dependency on
packagingby replacing version comparison.
1.16.0 - 2023-11-03
- Add optional
contextparameter for text translation, that specifies additional context to influence translations, that is not translated itself.
- Added notice in Readme that starting in 2024 the library will drop support for Python versions that are officially end-of-life.
- DeepL API calls now send requests with JSON-encoded bodies where possible.
- Catch failures while constructing the user agent string.
- Added
py.typedto the package so that our package is typed for our users. - Fixed most type errors in the package.
1.15.0 - 2023-06-09
- Removed
CHANGELOG.mdandSECURITY.mdfrom the python package. TheLICENSEfile is no longer installed, but still included in package tarball and wheel files.- Thanks to TurtleWilly for the report in #66.
- Fix a dependency error in our CI by updating to a higher poetry version in most cases.
- Fix getUsage request to be a HTTP GET request, not POST.
- Change document translation to poll the server every 5 seconds. This should greatly reduce observed document translation processing time.
1.14.0 - 2023-02-21
- Add example to translate JSON inputs.
- Added platform and python version information to the user-agent string that is sent with API calls, along with an opt-out.
- Added method for applications that use this library to identify themselves in API requests they make.
- Added
verify_ssloption toTranslatorto control underlyingrequestssession.- Thanks to andrefloriani for the suggestion in #60.
1.13.0 - 2023-01-26
-
Add example script to translate Mustache templates.
-
Add support for storing your API Key in a keyring via the
keyringmodule. -
Added a CI check for copyright headers.
-
New languages available: Korean (
'ko') and Norwegian (bokmål) ('nb'). Add language code constants and tests.Note: older library versions also support the new languages, this update only adds new code constants.
- Copyright headers are updated for 2023
- Update
certifito resolve security advisory.certifiis a development-only dependency; library users are unaffected.
1.12.0 - 2023-01-09
- State explicitly that this library supports Python 3.11.
- Added the
should_retryandhttp_status_codeproperties to all exceptions thrown by the library.
- Fix
pydependency by upgradingpytestversion to 7.2.0 for Python 3.7+. For Python 3.6 testspytestneeds to be added manually. - Remove unused
toxdependency. - Update
coveragedependency. - Also send options in API requests even if they are default values.
1.11.0 - 2022-09-26
- Add formality options
PREFER_LESSandPREFER_MORE.
- Requests resulting in
503 Service Unavailableerrors 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.
1.10.0 - 2022-09-09
-
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.
- Add note and workaround to README about Poetry error on Ubuntu 22.04.
- Pull request #48 thanks to FOehlschlaeger.
1.9.0 - 2022-07-07
- Add
Translator.create_glossary_from_csv()allowing glossaries downloaded from website to be easily uploaded to API.
1.8.0 - 2022-06-10
- Optional
filenameparameter added toTranslator.translate_document(), only required if uploading string or bytes containing file content.
- Update contributing guidelines, we can now accept Pull Requests.
- Fix GitLab CI config.
1.7.0 - 2022-05-18
-
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_reachedandany_limit_reachedproperties toUsageobject returned byget_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.
- Improve readme usage examples.
- Deprecate
limit_exceededandany_limit_exceededproperties ofUsageobject returned byget_usage(), uselimit_reachedandany_limit_reachedinstead.
1.6.0 - 2022-04-12
- Add
error_messageproperty toDocumentStatus, describing the error in case of document translation failure.
- Improve error message if
translate_text_with_glossaryis called without an instance ofGlossaryInfo. translate_documentandtranslate_document_from_filepathreturn finalDocumentStatus, allowing the number of billed characters to be queried.
1.5.1 - 2022-04-11
- Fix bug in CLI languages command causing some target languages to be omitted.
- Fix some tests that intermittently failed.
1.5.0 - 2022-02-28
- Add support for HTML tag handling in
translate_text().
DocumentTranslationException.document_requestis deprecated, usedocument_handleinstead.
1.4.1 - 2022-02-04
- Fix bug in
DocumentTranslationExceptionstringize function.
1.4.0 - 2022-01-19
- Add contribution guidelines -- currently we are unable to accept Pull Requests.
- Add
--glossary-idargument for CLI document command.
- Improve README.
- Raise
DocumentNotReadyExceptionwhen attempting to download a document before it has been translated. Previously the base classDeepLExceptionwas thrown.
- Add optional filename argument to
translate_document_upload()to fix uploading file content as string or bytes.
1.3.1 - 2021-11-15
- Limit document status update wait time to 60 seconds, and log wait times.
1.3.0 - 2021-11-15
Note: the PyPI package for 1.3.0 included changes from 1.3.1, so it has been yanked.
- Add glossary support for document translation.
- Add proxy support.
- Fix issues with parallelized tests by changing how test glossaries are created and deleted.
1.2.1 - 2021-10-19
- Add support for Python 3.10.
- 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.
1.2.0 - 2021-10-07
- Add
Translator.get_glossary_languages()to query language pairs supported for glossaries. - Add constants for all supported languages codes, for example:
Language.GERMAN.
- Internal language caching and client-side checking of language codes are removed.
- Some optional arguments related to language caching are now deprecated, and will be removed in a future version:
Translator(): theskip_language_checkargumentTranslator.get_source_languages()andTranslator.get_target_languages(): theskip_cacheargument
- Fix HTTP request retries for document uploads.
1.1.3 - 2021-09-27
- Loosen requirement for requests to 2.0 or higher.
1.1.2 - 2021-09-21
- Improve request exception messages and include exception stacktraces.
- Update unit tests for server error message changes.
1.1.1 - 2021-09-13
- Fix typing.List issue on Python 3.6.
- Add workaround for datetime.strptime bug in Python 3.6.
1.1.0 - 2021-09-13
- Add security policy.
- Add support for glossary API functions.
- README and comments improvements, type hints and other minor fixes.
1.0.1 - 2021-08-13
- Add explicit copyright notice to all source files.
- Force response encoding to UTF-8 to avoid issues with older versions of requests package.
1.0.0 - 2021-08-12
- All API calls use Authorization header instead of auth_key parameter.
0.4.1 - 2021-08-10
- Minor updates to pyproject.toml and README.md.
0.4.0 - 2021-08-05
Version increased to avoid conflicts with old packages on PyPI.
0.3.0 - 2021-08-05
- Package uploaded to PyPI. Thanks to Adrian Freund for transferring the deepl package name.
- Clarify minimum version of requests module to 2.18.
0.2.0 - 2021-07-28
- Improve exception hierarchy.
- Translator() server_url argument works with and without trailing slash.
- Translator.translate_text() accepts a single text argument, which may be a list or other iterable.
- Fix examples in readme to match function interface changes.
0.1.0 - 2021-07-26
Initial version.