Skip to content

Library for beautiful display of matrix and table

Notifications You must be signed in to change notification settings

VolodyaHoi/vismatrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

Visual Matrix

About:

Visual Matrix - module for python, allowing you to display matrices or tables in a beautiful form.

Functional:

  • Create and view tables and matrix;

Screenshots:

si5

Table visual

si5

Table visual (with border)

si5

Matrix visual

How to use:

from vismatrix import VisualMatrix

header = ["Name", "Age", "Sex"]

m = [["Alexandra", "18", "Female"],
     ["Igor", "21", "Male"],
     ["Vladimir", "18", "No"]]

matrix = VisualMatrix() # initialization

matrix.setMatrix(m, header, True) # method in which you can immediately initialize a matrix with header 
                                   # and without borders
matrix.myMatrix()

matrix.setMatrix(m) # method in which you can immediately initialize a matrix without header
matrix.myMatrix()

First way

from vismatrix import VisualMatrix

matrix = VisualMatrix() # initialization

# second way (in this way you cant change no_border parameter)
matrix.addHeader(["Name", "Age", "Sex"])
matrix.addRow(["Alexandra", "18", "Female"])
matrix.addRow(["Igor", "21", "Male"])
matrix.addRow(["Vladimir", "18", "No"])
matrix.myMatrix()

matrix.addRow(["Alexandra", "18", "Female"])
matrix.addRow(["Igor", "21", "Male"])
matrix.addRow(["Vladimir", "18", "No"])
matrix.myMatrix()

Second way

-The output from both methods will be the same. You can immediately assign lists to methods (as in the first method with header)

addHeader(header)

Adds a table header.

Parameter Type Description
header list Is the header for the table

addRow(row)

Adds a row table/matrix.

Parameter Type Description
row list Matrix or table row

setMatrix(user_matrix, header, no_border)

Creates a matrix or table (Depending on whether a header is specified or not).

Parameter Type Description
user_matrix list Matrix or table`s data
header list Table`s header
no_border bool Use borders (True - No, False - Yes)

myMatrix()

Output table or matrix. Must be written at the end of creating a matrix or table

Install:

pip install vismatrix

About

Library for beautiful display of matrix and table

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages