A Python wrapper for the DeepL API
Project description
deepl.py
A Python wrapper for the DeepL API
installing
Install and update using pip:
pip install deepl.py
A simple example.
# Sync Sample
import deepl
text = 'I have a pen.'
translator = deepl.Translator(deepl.RequestsAdapter('Your API key'))
def main():
print(translator.translate(text, target_lang=deepl.TargetLang.Japanese))
if __name__ == '__main__':
main()
#Async Sample
import asyncio
import deepl
text = 'I have a pen.'
translator = deepl.Translator(deepl.AiohttpAdapter('Your API key'))
async def main():
print(await translator.translate(text, target_lang=deepl.TargetLang.Japanese))
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Thank you to everyone who Helped me (#^^#)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
deepl.py-1.0.3.tar.gz
(6.4 kB
view details)
Built Distribution
File details
Details for the file deepl.py-1.0.3.tar.gz
.
File metadata
- Download URL: deepl.py-1.0.3.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73162b74a2079dccaf1f14bcb762e6d8123ccd86fe6db2c4cb17597b2772adb3 |
|
MD5 | b86feb2c293cd743f16b36485b52546b |
|
BLAKE2b-256 | 878ee737187066760f31a5120f516aab57e97cf61c7256fe7e32019dcda087cb |
File details
Details for the file deepl.py-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: deepl.py-1.0.3-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ba3b8fdad356e0ac5c585ac27f60c3ed44b57ea638b61b66cf0e6c331a9a802 |
|
MD5 | d1e6c097a375f8a1631fa93c0e98d915 |
|
BLAKE2b-256 | 02f4511a21bb285e28e2323040f89707930a2922fdc494352bf0048821d09978 |