Skip to content

Commit 25759c4

Browse files
committed
Update Readme
1 parent b5b6edc commit 25759c4

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

README.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,73 @@
11
# table2ascii
22

33
Module for converting 2D Python lists to a fancy ASCII/Unicode tables
4+
5+
- [table2ascii](#table2ascii)
6+
- [🧑‍💻 Usage](#-usage)
7+
- [⚙️ Options](#️-options)
8+
- [🧰 Development](#-development)
9+
10+
<!--
11+
## 📥 Installation
12+
13+
``pip install table2ascii``
14+
-->
15+
16+
## 🧑‍💻 Usage
17+
18+
Convert Python lists to ASCII tables
19+
20+
```py
21+
from table2ascii import table2ascii
22+
23+
output = table2ascii(
24+
header_row=["#", "G", "H", "R", "S"],
25+
body=[["1", "30", "40", "35", "30"], ["2", "30", "40", "35", "30"]],
26+
footer_row=["SUM", "130", "140", "135", "130"],
27+
)
28+
29+
print(output)
30+
31+
"""
32+
╔═════╦═══════════════════════╗
33+
║ # ║ G H R S ║
34+
╟─────╫───────────────────────╢
35+
║ 1 ║ 30 40 35 30 ║
36+
║ 2 ║ 30 40 35 30 ║
37+
╟─────╫───────────────────────╢
38+
║ SUM ║ 130 140 135 130 ║
39+
╚═════╩═══════════════════════╝
40+
"""
41+
```
42+
43+
```py
44+
from table2ascii import table2ascii
45+
46+
output = table2ascii(
47+
body=[["1", "30", "40", "35", "30"], ["2", "30", "40", "35", "30"]]
48+
)
49+
50+
print(output)
51+
52+
"""
53+
╔═════╦═══════════════════════╗
54+
║ 1 ║ 30 40 35 30 ║
55+
║ 2 ║ 30 40 35 30 ║
56+
╚═════╩═══════════════════════╝
57+
"""
58+
```
59+
60+
## ⚙️ Options
61+
62+
Soon table2ascii will support more options for customization.
63+
64+
65+
## 🧰 Development
66+
67+
To run tests (pytest)
68+
69+
``python setup.py test``
70+
71+
To lint (flake8):
72+
73+
``python setup.py lint``

0 commit comments

Comments
 (0)