Python - создайте текстовую границу с динамическим размером

from tabulate import tabulate

text = """
some words that
could be dynamic but 
are currently static
"""

table = [[text]]
output = tabulate(table, tablefmt='grid')

print(output)




# Output:
+-----------------------+
| some words that       |
| could be dynamic but  |
| are currently static  |
+-----------------------+
corsair2014