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

Method list_glossaries

deepl/translator.py:1144–1156  ·  view source on GitHub ↗

Retrieves GlossaryInfo for all available glossaries. :return: list of GlossaryInfo for all available glossaries.

(self)

Source from the content-addressed store, hash-verified

1142 return GlossaryInfo.from_json(json)
1143
1144 def list_glossaries(self) -> List[GlossaryInfo]:
1145 """Retrieves GlossaryInfo for all available glossaries.
1146
1147 :return: list of GlossaryInfo for all available glossaries.
1148 """
1149 status, content, json = self._api_call("v2/glossaries", method="GET")
1150 self._raise_for_status(status, content, json, glossary=True)
1151 glossaries = (
1152 json.get("glossaries", [])
1153 if (json and isinstance(json, dict))
1154 else []
1155 )
1156 return [GlossaryInfo.from_json(glossary) for glossary in glossaries]
1157
1158 def get_glossary_entries(self, glossary: Union[str, GlossaryInfo]) -> dict:
1159 """Retrieves the entries of the specified glossary and returns them as

Callers 2

action_glossary_listFunction · 0.80
test_glossary_listFunction · 0.80

Calls 3

_api_callMethod · 0.95
_raise_for_statusMethod · 0.95
from_jsonMethod · 0.45

Tested by 1

test_glossary_listFunction · 0.64