Create pretty looking ascii tables
Project description
ascii-tables
Create a pretty looking ascii table.
Usage (command line):
python ascii-tables.py [options] < input_file.txt
Where input_file.txt
contains your input separated by (any amount of) tabs or 4/8/.. spaces and new-line characters and the output table is printed on the terminal.
Usage (gui):
python gui.py
Example:
Input:
Col 1 Col 2 Col 3 Col 4
Val1 Val2 Val3 Val4
Val11 Val22 Val33 Val44
Vala Valb Valc Vald
Output (-h option):
+-------+-------+-------+-------+
| Col 1 | Col 2 | Col 3 | Col 4 |
+=======+=======+=======+=======+
| Val1 | Val2 | Val3 | Val4 |
+-------+-------+-------+-------+
| Val11 | Val22 | Val33 | Val44 |
+-------+-------+-------+-------+
| Vala | Valb | Valc | Vald |
+-------+-------+-------+-------+
The input in the command line execution can have an arbitrary amount of tabs separating the values. For example either one of the following inputs will output the same result:
Inputs:
input_size algorithmA algorithmB algorithmC algorithmD
1 206.4 sec. 206.4 sec. 0.02 sec. 0.02 sec.
4 900 sec. 431.1 sec. 0.08 sec. 0.062 sec.
250 - 80 min. 2.27 sec. 1.305 sec.
1000 - - 8.77 sec. 4.086 sec.
5000 - - 33.53 sec. 16.80 sec.
10000 - - 85.4 sec. 47.18 sec.
or
input_size algorithmA algorithmB algorithmC algorithmD
1 206.4 sec. 206.4 sec. 0.02 sec. 0.02 sec.
4 900 sec. 431.1 sec. 0.08 sec. 0.062 sec.
250 - 80 min. 2.27 sec. 1.305 sec.
1000 - - 8.77 sec. 4.086 sec.
5000 - - 33.53 sec. 16.80 sec.
10000 - - 85.4 sec. 47.18 sec.
Output (-h and -v options):
+------------+------------+------------+------------+------------+
| input_size ‖ algorithmA | algorithmB | algorithmC | algorithmD |
+============+============+============+============+============+
| 1 ‖ 206.4 sec. | 206.4 sec. | 0.02 sec. | 0.02 sec. |
+------------+------------+------------+------------+------------+
| 4 ‖ 900 sec. | 431.1 sec. | 0.08 sec. | 0.062 sec. |
+------------+------------+------------+------------+------------+
| 250 ‖ - | 80 min. | 2.27 sec. | 1.305 sec. |
+------------+------------+------------+------------+------------+
| 1000 ‖ - | - | 8.77 sec. | 4.086 sec. |
+------------+------------+------------+------------+------------+
| 5000 ‖ - | - | 33.53 sec. | 16.80 sec. |
+------------+------------+------------+------------+------------+
| 10000 ‖ - | - | 85.4 sec. | 47.18 sec. |
+------------+------------+------------+------------+------------+
Options:
- [
-h
double horizontal line after first row. (Uses '=' character)] - [
-v
double vertical line after first column. (Uses '‖' unicode character)]
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
ascii-tables-0.0.2.tar.gz
(2.1 kB
view hashes)
Built Distributions
Close
Hashes for ascii_tables-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9493456eabf9ae2fdefd89f51f52af4a0184d3d739fff739fc03c29a32519e2 |
|
MD5 | 69ce292966fb6365b7c43a14d05f0eee |
|
BLAKE2b-256 | 0c77a252ce1d9e145b814dc409249def64d6a5c3ee2dc6fa18f804e23d9b32c0 |
Close
Hashes for ascii_tables-0.0.2-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27401b978b317b3b128cab1987e21426f8b04ecb92012c9502fe46b0f69b154a |
|
MD5 | 311f0107f375ee92398df4717d86a6e7 |
|
BLAKE2b-256 | 7077fafd77f6200eae9247fab006251820cca3166266010a6a64ab2e2effe9ca |