RELEASE: Version 1.0 (#3)

This commit is contained in:
2022-06-25 22:27:01 +01:00
committed by GitHub
parent 374d77a2d1
commit e374dc195b
15 changed files with 354 additions and 3 deletions

22
app/print_table.py Normal file
View File

@ -0,0 +1,22 @@
#!/usr/bin/env python3
"""MODULE: Provides functions for preparing, then printing, retrieved data."""
from tabulate import tabulate
def generate_prefix_string(prefixes: list) -> str:
"""Generate a string that spilts prefixes into rows of 4."""
num_per_row = 4
try:
ret = ""
for i in range(0, len(prefixes), num_per_row):
ret += ", ".join(prefixes[i : i + num_per_row]) + "\n"
return ret
except AttributeError:
return None
def print_table(table_data) -> None:
"""Print table generated by tabulate."""
print(tabulate(table_data))