Convert 2D Python lists into Unicode/Ascii tables
Project description
table2ascii
Module for converting 2D Python lists to a fancy ASCII/Unicode tables
๐ฅ Installation
pip install table2ascii
๐งโ๐ป Usage
Convert Python lists to ASCII tables
from table2ascii import table2ascii
output = table2ascii(
header=["#", "G", "H", "R", "S"],
body=[["1", "30", "40", "35", "30"], ["2", "30", "40", "35", "30"]],
footer=["SUM", "130", "140", "135", "130"],
)
print(output)
"""
โโโโโโโฆโโโโโโโโโโโโโโโโโโโโโโโโ
โ # โ G H R S โ
โโโโโโโซโโโโโโโโโโโโโโโโโโโโโโโโข
โ 1 โ 30 40 35 30 โ
โ 2 โ 30 40 35 30 โ
โโโโโโโซโโโโโโโโโโโโโโโโโโโโโโโโข
โ SUM โ 130 140 135 130 โ
โโโโโโโฉโโโโโโโโโโโโโโโโโโโโโโโโ
"""
from table2ascii import table2ascii
output = table2ascii(
body=[["1", "30", "40", "35", "30"], ["2", "30", "40", "35", "30"]]
)
print(output)
"""
โโโโโโโฆโโโโโโโโโโโโโโโโโโโโโโโโ
โ 1 โ 30 40 35 30 โ
โ 2 โ 30 40 35 30 โ
โโโโโโโฉโโโโโโโโโโโโโโโโโโโโโโโโ
"""
โ๏ธ Options
Soon table2ascii will support more options for customization.
๐งฐ Development
To run tests (pytest)
python setup.py test
To lint (flake8):
python setup.py lint
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
table2ascii-0.0.1.tar.gz
(4.9 kB
view hashes)
Built Distribution
Close
Hashes for table2ascii-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a272af36544c3a555559620f9195a2ada59a4d688db20ff402aa8e56670bf9d |
|
MD5 | 19f0020fe3c582d7ecb30829e336ce4f |
|
BLAKE2b-256 | b66f0ddf3b136642afe08b9b3e0a56c69961f525996812460f5443c0a28a587b |