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 withmake_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-4.9-py3-none-any.whl
.
File metadata
- Download URL: Tangly-4.9-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 | 951e2a4520a080a7bd80d7e258b831edb0892fffc2e867f683a4d641c17967c6 |
|
MD5 | 5b1e8d3b4116639840238cacfec23ded |
|
BLAKE2b-256 | a33237b316efea43604315bb46c26c26890ea5bbd0cae6877a36f99868bfe4ad |