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

Method get_glossary

deepl/translator.py:1130–1142  ·  view source on GitHub ↗

Retrieves GlossaryInfo for the glossary with specified ID. :param glossary_id: ID of glossary to retrieve. :return: GlossaryInfo with information about specified glossary. :raises GlossaryNotFoundException: If no glossary with given ID is found.

(self, glossary_id: str)

Source from the content-addressed store, hash-verified

1128 )
1129
1130 def get_glossary(self, glossary_id: str) -> GlossaryInfo:
1131 """Retrieves GlossaryInfo for the glossary with specified ID.
1132
1133 :param glossary_id: ID of glossary to retrieve.
1134 :return: GlossaryInfo with information about specified glossary.
1135 :raises GlossaryNotFoundException: If no glossary with given ID is
1136 found.
1137 """
1138 status, content, json = self._api_call(
1139 f"v2/glossaries/{glossary_id}", method="GET"
1140 )
1141 self._raise_for_status(status, content, json, glossary=True)
1142 return GlossaryInfo.from_json(json)
1143
1144 def list_glossaries(self) -> List[GlossaryInfo]:
1145 """Retrieves GlossaryInfo for all available glossaries.

Callers 4

action_glossary_getFunction · 0.80
test_glossary_createFunction · 0.80
test_glossary_getFunction · 0.80
test_glossary_deleteFunction · 0.80

Calls 3

_api_callMethod · 0.95
_raise_for_statusMethod · 0.95
from_jsonMethod · 0.45

Tested by 3

test_glossary_createFunction · 0.64
test_glossary_getFunction · 0.64
test_glossary_deleteFunction · 0.64