tabuletta
Installation
Installing this library is super easy!
pip install tabuletta
Intro
Tbuletta is a python library that print's arrays in a tabular form with some customisation.
Example
This library is extremly simple, to use it make a list of lists, each inner list should be a row. The amount of elements in each inner list needs to be uniform.
For example,
table = [
[5, 2, 3.5],
[4.1, 900, 2],
["Sup", 5, 1]
]
Will print:
+-----------------+
| 5 | 2 | 3.5 |
| 4.1 | 900 | 2 |
| Sup | 5 | 1 |
+-----------------+
It can also print:
+-----------------+
| 5 | 2 | 3.5 |
+-----+-----+-----+
| 4.1 | 900 | 2 |
| Sup | 5 | 1 |
+-----------------+
It's all your choice.
Using tabuletta
To use tabuletta, simply import tabuletta after following the installation instructions from above
import tabuletta
Then, create the list you would like to print
myList = [
["Reg no", "Email"],
["20ABC1000", "John@fakeemail.com"],
["21BCD0001", "Wick@fakeemail.com"]
]
Then simply print it! Choose whether or not you would like field names (use True if so, don't put anything if not (don't include useFieldNames at all) because it defaults to False).
# NOTE: useFieldNames defaults to False, so, if you don't type useFieldNames=True it automatically goes to False
tabuletta.printTable(myList, useFieldNames=True)
As output, you get:
+-----------------------------------------------+
| Reg no | Email |
+-----------------------+-----------------------+
| 20ABC1000 | John@fakeemail.com |
| 21BCD0001 | Wick@fakeemail.com |
+-----------------------------------------------+
If you didn't want to use field names then you would only have to write:
tabuletta.printTable(myList)
Another example:
myList = [
["", "a", "b"],
["x", "a + x", "a + b"],
["z", "a + z", "z + b"]
]
From that, you get:
+-----------------------+
| | a | b |
+-------+-------+-------+
| x | a + x | a + b |
| z | a + z | z + b |
+-----------------------+
Using colors
You might want to use colors in tabuletta.
To use them simply use RGB values, so, using the example from above:
import tabuletta
myList = [
["", "a", "b"],
["x", "a + x", "a + b"],
["z", "a + z", "z + b"]
]
# give the color name
tabuletta.printTable(myList, useFieldNames=True, color="red")
As output you get:
Some more examples of colors:
The available color options are : red, blue, orange, cyan, pink, green, yellow
Metadata
Release files for tabuletta 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tabuletta-0.2.2.tar.gz | 4.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tabuletta-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.9 kB
Release files / tabuletta-0.2.2.tar.gz
| Download URL | tabuletta-0.2.2.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
12a918208a6aa34018925d0080ad635d40fcaa0b55b682cdd03aae14335ac5be
|
|
BLAKE2b-256 checksum How to use checksums |
46070b73a14df249681b731828daf83ee41fbcc5397f84e1f13f5f40c47f9429
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / tabuletta-0.2.2-py3-none-any.whl
| Download URL | tabuletta-0.2.2-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
550066255933b26fcddfe87f619ddef127749f4dabc08ae00d035626517153d0
|
|
BLAKE2b-256 checksum How to use checksums |
a5cd69acfba904ec6dbe22497547197ef56c86636ec04ad08b3f810e44765f43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|