MCPcopy Create free account
hub / github.com/DeepL/deepl-python / get_source_languages

Method get_source_languages

deepl/translator.py:970–987  ·  view source on GitHub ↗

Request the list of available source languages. :param skip_cache: Deprecated, and now has no effect as the corresponding internal functionality has been removed. This parameter will be removed in a future version. :return: List of supported source languages.

(self, skip_cache: bool = False)

Source from the content-addressed store, hash-verified

968 return response
969
970 def get_source_languages(self, skip_cache: bool = False) -> List[Language]:
971 """Request the list of available source languages.
972
973 :param skip_cache: Deprecated, and now has no effect as the
974 corresponding internal functionality has been removed. This
975 parameter will be removed in a future version.
976 :return: List of supported source languages.
977 """
978 status, content, json = self._api_call("v2/languages", method="GET")
979 self._raise_for_status(status, content, json)
980 languages = json if (json and isinstance(json, list)) else []
981 return [
982 Language(
983 language["language"],
984 language["name"],
985 )
986 for language in languages
987 ]
988
989 def get_target_languages(self, skip_cache: bool = False) -> List[Language]:
990 """Request the list of available target languages.

Callers 3

action_languagesFunction · 0.80
test_source_langFunction · 0.80
test_languageFunction · 0.80

Calls 3

_api_callMethod · 0.95
_raise_for_statusMethod · 0.95
LanguageClass · 0.90

Tested by 2

test_source_langFunction · 0.64
test_languageFunction · 0.64