Skip to content

anfederico/tableize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

                PyPI version Build Status Dependencies GitHub Issues Contributions welcome License

Install

pip install tableize

Code Examples

Create a table with 5 columns

from tableize import tableize

letters = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o']

t = tableize(letters, cols = 5)
t.show()
a b c d e 
f g h i j 
k l m n o 

Flip how the table is filled

t.flip()
t.show()
a d g j m 
b e h k n 
c f i l o 

Create a table with 10 rows

from tableize import tableize

t = tableize(letters, rows = 10)
t.show()
a k 
b l 
c m 
d n 
e o 
f 
g 
h 
i 
j 

Switch from rows to columns

t.switch()
t.show()
a b c d e f g h i j 
k l m n o

More customization

from tableize import tableize

words = ['apple','bus','cart','drum','empty','flint','get','happy','ill','joker','kneel','lard','no','mop']                   

t = tableize(words, cols = 5)
t.text(bullet = '+ ', spaces = 2, spacer = ' ')
- apple  - bus   - cart   - drum  - empty  
- flint  - get   - happy  - ill   - joker  
- kneel  - lard  - no     - mop  
t.text(bullet = '', spaces = 5, spacer = '~')
apple~~~~~bus~~~~~~cart~~~~~~drum~~~~~empty~~~~~
flint~~~~~get~~~~~~happy~~~~~ill~~~~~~joker~~~~~
kneel~~~~~lard~~~~~no~~~~~~~~mop~~~~~~open~~~~~~
t.write(filename = 'mytable', bullet = '+ ', spaces = 3, spacer = ' ')
mytable.txt

+ apple   + bus    + cart    + drum   + empty   
+ flint   + get    + happy   + ill    + joker   
+ kneel   + lard   + no      + mop  

Releases

No releases published

Packages

 
 
 

Languages