Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

Tangly-5.0-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file Tangly-5.0-py3-none-any.whl.

File metadata

  • Download URL: Tangly-5.0-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for Tangly-5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 94a55fcf67b9ddcdd7914c87517adc340bb0a6e113bb91ca2fd9972fe4c36957
MD5 b1bee9e6d66ebfcc8772d07cce598a68
BLAKE2b-256 b922450509a6e511c7d25b00e6f10ebe766453713f035d8d49a522e16ca135ce

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page