Unofficial free DeepL translator client (No auth)
Project description
free-deepl-translator
Unofficial free DeepL translator client for Python — this package lets you translate text using DeepL without requiring an API key by or an Auth token.
⚠️ Unofficial: this project reverse-engineers DeepL's web protocol. It may break if DeepL changes their site and may violate DeepL's Terms of Service. Use at your own risk.
Installation
Install from PyPI:
pip install free-deepl-translator
Quick example
import free_deepl_translator as deepl
# Create the client
deepl_instance = deepl.DeeplTranslator()
# Create a session (returns True on success and False on failure)
d = deepl_instance.Session() # use *.SessionAsync() for async version
if d != True:
print(f"Error")
exit(1)
print("Session created")
# Simple translate to French
translated = deepl_instance.Translate("H-h-how are you ?\nPlease answer me", target_lang="fr") # use *.TranslateAsync() for async version
if translated["status"] == 0:
print(f"Translated text: {translated['text']}")
#time.sleep(5)
# Translate from French to English
translated = deepl_instance.Translate("Je vais bien, merci", target_lang="en", source_lang="fr")
if translated["status"] == 0:
print(f"Translated text: {translated['text']}")
# Advanced call: specify model, glossary and formality
translated = deepl_instance.Translate(
"Can you please send me the report?",
target_lang="ja",
source_lang="en",
target_model="next-gen",
glossary=[{"source": "report", "target": "動画"}],
formality="formal",
)
if translated["status"] == 0:
print(f"Translated text: {translated['text']}")
# Close the Session
deepl_instance.Close() # use *.CloseAsync() for async version
To use it with Async you can use SessionAsync(), TranslateAsync() and CloseAsync().
Return format
Translate() and TranslateAsync() return a dictionary like:
{
"status": 0, # 0 = success, non-zero = error
"text": "...", # translated text when successful
"msg": "...", # error message (when status != 0)
}
Features
- Translate text without an API key (no auth).
- Supports explicit
source_lang. target_modelselection (e.g.next-genorclassic).- Glossary entries (list of
{source, target}mappings). formality | tonecontrol.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file free_deepl_translator-1.2.2-py3-none-any.whl.
File metadata
- Download URL: free_deepl_translator-1.2.2-py3-none-any.whl
- Upload date:
- Size: 13.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e7db7503ad678aec0a641efd41bfeef2d2ffa96e62fd43115dec717110b425e
|
|
| MD5 |
6df1244adaa0a38119348b4cdd7f29f7
|
|
| BLAKE2b-256 |
c9045c8a879132ff4c1e2273781b43f5046e5bd68688329a3d05d68db196b929
|