deepl-python icon indicating copy to clipboard operation
deepl-python copied to clipboard

New tag_handling_version parameter not supported

Open KenSentMe opened this issue 4 weeks ago • 5 comments

The DeepL API now supports the tag_handling_version parameter. However, this parameter is not yet supported by this package.

KenSentMe avatar Dec 01 '25 16:12 KenSentMe

Sorry we have not documented this well yet (in progress). You can use it as follows:

import deepl

auth_key = "f63c02c5-f056-..."  # Replace with your key
deepl_client = deepl.DeepLClient(auth_key)

deepl_client.translate_text("<div>How are you?</div>", target_lang="DE", tag_handling="xml", model_type="quality_optimized", extra_body_parameters={"tag_handling_version": "v2"})

JanEbbing avatar Dec 01 '25 16:12 JanEbbing

This might not be a permanent parameter in our API, so I'm hesitant to add it to our client libraries.

JanEbbing avatar Dec 01 '25 16:12 JanEbbing

Thank you for the clarification. Is your hesitation because the improved tag handling might become default in the future, making this version setting obsolete?

KenSentMe avatar Dec 02 '25 07:12 KenSentMe

Yes exactly, that is our intention.

JanEbbing avatar Dec 02 '25 08:12 JanEbbing

Perfect. For now I'm going to use the extra_body_parameters method, since I see some weird behavior on line breaks when using the default tag handler.

KenSentMe avatar Dec 02 '25 09:12 KenSentMe