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

Function print_glossaries

deepl/__main__.py:176–209  ·  view source on GitHub ↗
(glossaries)

Source from the content-addressed store, hash-verified

174
175
176def print_glossaries(glossaries):
177 headers = [
178 "Glossary ID",
179 "Name",
180 "Ready",
181 "Source",
182 "Target",
183 "Count",
184 "Created",
185 ]
186 data = [
187 [
188 glossary.glossary_id,
189 glossary.name,
190 str(glossary.ready),
191 glossary.source_lang,
192 glossary.target_lang,
193 str(glossary.entry_count),
194 str(glossary.creation_time),
195 ]
196 for glossary in glossaries
197 ]
198 data.insert(0, headers)
199
200 col_max_widths = [
201 max(len(row[col_num]) for row in data)
202 for col_num in range(len(headers))
203 ]
204 for row in data:
205 print(
206 "\t".join(
207 [col.ljust(width) for col, width in zip(row, col_max_widths)]
208 )
209 )
210
211
212def action_glossary_list(deepl_client: deepl.DeepLClient):

Callers 3

action_glossary_createFunction · 0.85
action_glossary_listFunction · 0.85
action_glossary_getFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected