Skip to main content

Module for creating tables for console applications

Project description

PythonTableConsole

Simple console-oriented handler for python two-dimensional lists (tables). Put your list in handler, modify it and use it from handler or take it out from handler and use on its own.

Features:

  • List handler that works with python 2-dimensional lists.
  • Easy access to height and width of the table.
  • Simple handy functions: transposing and sorting.
  • Print your lists as tables to the console!

Examples:

Creating table from list:

import PythonTableConsole as PTC
my_list = [['a', 'b', 'c'], [1, 2, 3], [7,4,3,2,0,10]]
Table = PTC.PythonTableConsole(my_list)
# or PTC.PythonTableConsole([['a', 'b', 'c'], [1, 2, 3], [7,4,3,2,0,10]])

Printing table to the console:

print(Table)

Changing table:

Table.contains[0][0] = 'alpha'

Functions of the PythonTableConsole class:

Table.width()  # returns number of columns
Table.height()  # returns number of rows
Table.transpose()  # transposes the Table: rows to columns, columns to rows
Table.sort_by_column(column_index, skip_n_rows = 0)  # sorts the table (except first n rows) by specified column. MAY BE REMOVED IN THE FUTURE
Table.sort_by_column_with_skips(column_index, skip_rows = [], skip_columns = [], largest_at_the_top = True)  # sorts the table (except specified rows and columns) by the specified column.
Table.sort_by_row_with_skips(row_index, skip_rows = [], skip_columns = [], largest_at_the_top = True)  # sorts the table (except specified rows and columns) by the specified row.

Project details


Download files

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

Source Distribution

PythonTaCo-1.3.4.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PythonTaCo-1.3.4-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file PythonTaCo-1.3.4.tar.gz.

File metadata

  • Download URL: PythonTaCo-1.3.4.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for PythonTaCo-1.3.4.tar.gz
Algorithm Hash digest
SHA256 6bf90650231d1ff637058d8caba35111297907a67eb53ecb992fc999889332ed
MD5 648a676b1f528d2773c1455c4ef29c65
BLAKE2b-256 556cc8404ea33e8597180611e36bc11180725d33cc1c1c1586fdb5f32599de43

See more details on using hashes here.

File details

Details for the file PythonTaCo-1.3.4-py3-none-any.whl.

File metadata

  • Download URL: PythonTaCo-1.3.4-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for PythonTaCo-1.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9cd13caf2a49afacb0ad557993f7bb1dd4d055f6d873331add7e2ce1d0101485
MD5 e0c6a2a7159355dd64a767df7e247ca4
BLAKE2b-256 dab78dd0b87d16b2fe08bbbf2ae9029db0abb80ad0c684438296c2ad94f38067

See more details on using hashes here.

Supported by

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