No project description provided
Project description
Tangly is a modules that allows you to print beautifull tables in python
To install:
pip install tangly
To import into your code:
import tangly
Say we have a nested list with information about people:
people = [["Name", "Last Name", 'Age', "Number"],
["Nath", "Dezem", '20', '137'],
["Rafa", "Rayes",'19', '4976'],
['Johny', 'Dias', '22', '1234']]
If we want to display it as a table we can use:
print_table(people)
Output:
┌───────┬──────────────────────────┐
│ Name │ Last Name Age Number │
├───────┼──────────────────────────┤
│ Nath │ Dezem 20 137 │
│ Rafa │ Rayes 19 4976 │
│ Johny │ Dias 22 1234 │
└───────┴──────────────────────────┘
If you only want to save the result you can get the string with make_table()
print_table()
is equivalent to print(make_table())
You can controll which collumns and rows are separated using a similar nested list, like so [[0,2],[0,1]]
. By default this is [[0],[0]]
which means only the first row and first collumn are separated.
print_table(my_list, [[0,2],[0,1]])
This will be the output:
┌───────┬───────────┬──────────────┐
│ Name │ Last Name │ Age Number │
├───────┼───────────┼──────────────┤
│ Nath │ Dezem │ 20 137 │
│ Rafa │ Rayes │ 19 4976 │
├───────┼───────────┼──────────────┤
│ Johny │ Dias │ 22 1234 │
└───────┴───────────┴──────────────┘
This was done in 2019 when I was learning python. I know no one will ever use this. Updated in 2024 just to fix it.
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 Distributions
Built Distribution
File details
Details for the file Tangly-5.1-py3-none-any.whl
.
File metadata
- Download URL: Tangly-5.1-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 701a708935b26cf7b3a52296b7b811d91db134d02a9e172a6d77ffa22cda74c8 |
|
MD5 | fd07873575c1d191bd1cf9e20237e2d7 |
|
BLAKE2b-256 | ece0e463db3c6e5fe6adbd0d147e35bd5b8ff6127186fc393e2b88ff5085ff4f |