Create pretty looking ascii tables
Project description
cli_tables
Create a pretty looking ascii table.
Usage (command line):
python cli_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
cli_tables-0.0.1.tar.gz
(3.2 kB
view hashes)
Built Distributions
Close
Hashes for cli_tables-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c13b962387e22aa441c452721d5a8ea7b6158417b12cd6f9e10f5ab47f5c6235 |
|
MD5 | c1d51f70f86af15d000ff9e50714fd76 |
|
BLAKE2b-256 | 39113ad9240e81bac33da32bf6c8b8797ef6a4c4fd050c9db262ba7c6fd5e658 |
Close
Hashes for cli_tables-0.0.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a57a3545482d60b2c81da992c1b093618fc352ed436bd2645ff53c8ab77c79a6 |
|
MD5 | bbb2ba396bf185e84ce8aedb776da3c8 |
|
BLAKE2b-256 | bc7517f8617054e1729decd9d72bc2cfdc6d09712daa52d8af5460a5e07f2bf6 |