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:
1. [`-h` double horizontal line after first row. (Uses '=' character)]
2. [`-v` double vertical line after first column. (Uses '‖' unicode character)]
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:
1. [`-h` double horizontal line after first row. (Uses '=' character)]
2. [`-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.3.tar.gz
(3.1 kB
view details)
Built Distribution
File details
Details for the file ascii-tables-0.0.3.tar.gz
.
File metadata
- Download URL: ascii-tables-0.0.3.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.2 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.15rc1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5ad6f0e890f34b4c021888ee29df90059e91e75030be41cbf6f3ed246adf9b3 |
|
MD5 | 575b85f9134fcee5117a32c13a7c3e4b |
|
BLAKE2b-256 | 7bd187dd434c0bd3028e4d975c7b0e8d3cff40d0589b77e36b3224d98fbc2386 |
File details
Details for the file ascii_tables-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: ascii_tables-0.0.3-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.2 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.15rc1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06cf008dd18c723cb2694bffd52a7304ca8fe6e94c9075349abd82c8b21b15ff |
|
MD5 | 6a0eb43fb64398873c742dbf0af74b51 |
|
BLAKE2b-256 | 5dcd4298da29ec0dc3a464fc14a330ef701d231f5ff74cdcaffb58c759635f52 |