Skip to main content

Fetch result from a deepl-fastapi API.

Project description

fetch-deepl

pytestpythonCode style: blackLicense: MITPyPI version

Fetch translation text from a deepl-fastapi API.

Install it

pip install fetch-deepl

# pip install git+https://github.com/ffreemt/fetch-deepl
# poetry add git+https://github.com/ffreemt/fetch-deepl
# git clone https://github.com/ffreemt/fetch-deepl && cd fetch-deepl

Use it

from fetch_deepl import fetch_deepl

print(fetch_deepl("Tell me and I forget. Teach me and I remember. Involve me and I learn."))
# 告诉我,我就忘了。教导我,我就记住。让我参与,我就学

print(fetch_deepl("书山有路勤为径"))
# There is a path to the mountain of books and diligence is the path

print(fetch_deepl("There is a path to the mountain of books and diligence is the path", from_lang="en", to_lang="de"))
# Es gibt einen Weg zum Berg der Bücher und Fleiß ist der Weg

print(fetch_deepl("书山有路勤为径", from_lang="zh", to_lang="de"))
# Es gibt einen Weg durch die Berge des Lernens und des Fleißes

Supported languages can be obtained from deepl's homepage, as of today:

from pprint import pprint
from fetch_deepl import lang_dict
pprint(lang_dict)
{'bg': 'Bulgarian',
 'cs': 'Czech',
 'da': 'Danish',
 'de': 'German',
 'el': 'Greek',
 'en': 'English',
 'es': 'Spanish',
 'et': 'Estonian',
 'fi': 'Finnish',
 'fr': 'French',
 'hu': 'Hungarian',
 'id': 'Indonesian',
 'it': 'Italian',
 'ja': 'Japanese',
 'lt': 'Lithuanian',
 'lv': 'Latvian',
 'pl': 'Polish',
 'pt': 'Portuguese',
 'ro': 'Romanian',
 'ru': 'Russian',
 'sk': 'Slovak',
 'sl': 'Slovenian',
 'sv': 'Swedish',
 'tr': 'Turkish',
 'zh': 'Chinese (simpl.)'}

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

fetch-deepl-0.1.2.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

fetch_deepl-0.1.2-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page