csvtomd
csvtomd copied to clipboard
Document for using md_table directly in python
Although it's quite obvious by reading the source code, but it would be great to add a section like this in README.md:
from csvtomd import md_table
table_2d_array = [["First Name", "Last Name", "Location" , "Allegiance"],
["Mance", "Rayder", "North of the Wall", "Wildlings"],
["Margaery", "Tyrell", "The Reach", "House Tyrell"],
["Danerys", "Targaryen", "Meereen", "House Targaryen"],
["Tyrion", "Lannister", "King's Landing", "House Lannister"]]
md_table(table_2d_array)
"""
('First Name | Last Name | Location | Allegiance\n'
'------------|-------------|---------------------|-----------------\n'
'Mance | Rayder | North of the Wall | Wildlings\n'
'Margaery | Tyrell | The Reach | House Tyrell\n'
'Danerys | Targaryen | Meereen | House Targaryen\n'
"Tyrion | Lannister | King's Landing | House Lannister")
"""
Because I have already spent that five minutes, other people don't have to.