Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 18, 2023. It is now read-only.

grarich/deepl.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

114 Commits

Repository files navigation

deepl.py

A Python wrapper for the DeepL API

GitHub license GitHub issues GitHub forks GitHub stars check PyPI version Python Versions Downloads

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 (#^^#)

AltStyle によって変換されたページ (->オリジナル) /