_rrTable Class

class rrGlobal._rrTable

Store and export tables

Cells

Each table cell can store data of 4 different types :

  • Integer (64 bit)

  • Float

  • String

  • Datetime

Row/Column finder helper

There are some helper functions to place data if you only know the column or row title, but not the index of the row/column. If the date or name does not exist, it is added.

For these functions, the rrTable will use:

  • Names for the title of the columns

  • Date for the title of the rows (can be sorted after date in the end)

Example Table :

NameA

NameB

01.May.2017

15.Okt.2017

01.June.2017

In addition to:

>>> my_table.setString(col=1, row=3, text='My Text')

you can use

>>> my_table.setStringbyName('NameA', 3, 'My Text')

or

>>> my_table.setStringbyName('NameA', 3, 'My Text')

or

>>> my_table.setStringbyNameNDate('NameA', datetime(2017, 6, 1), 'My Text')

class _rrTable functions:

Return Type

Name

Description

addFloat(int col, int row, float number)

Please see setDecimalSeperator() as well

addFloatByName(str name, int row, float number)
addInt(int col, int row, int number)
addIntByName(str name, int row, int number)

float

cellAsFloat(int col, int row)

int

cellAsInt(int col, int row)

str

cellAsString(int col, int row)

int

cellType(int col, int row)

int

colIndex(str name, bool addColumn)

If name is not found and addColumn is True, a new column is added to the table

int

columnCount()

Number of columns of the table

str

fileError()

Contains the error message if saveAsCsv returned False

bool

outOfBounds(int column, int row)

Returns True if the coordinates are outside the current table size.

int

rowCount()

Number of rows of the table

int

rowIndex(str name, bool addRow)

If name is not found and addrow is True, a new row is added to the table

int

rowIndexDate(datetime.datetime day, bool addRow)

If day is not found and addrow is True, a new row is added to the table

bool

saveAsCsv(str filename, bool switchColRow)

Saves the table as .csv file. Returns True if it was successful. On Windows, the separator depends from the system settings

bool

saveAsCsvComma(str filename, bool switchColRow)

like saveAsCsv(), but enforce comma separator

bool

saveAsCsvSemicolon(str filename, bool switchColRow)

like saveAsCsv(), but enforce semicolon separator

bool

saveAsHtml(str filename)

Saves the table as .htm file. Returns True if it was successful.

setDatetime(int col, int row, datetime.datetime time)
setDecimalSeperator(str character)

By default, rrTable uses a point as decimal separator. On windows, it reads your system settings. You can override this behavior with this function

setFloat(int col, int row, float number)
setFloatByName(str name, int row, float number)
setFloatByNameNDate(str name, datetime.datetime day, float number)
setHeader(int column, str text)

Sets the column title.

setHeaderDatetime(int column, datetime.datetime time)

Sets the column datetime

setInt(int col, int row, int number)
setIntByName(str name, int row, int number)
setIntByNameNDate(str name, datetime.datetime day, int number)
setString(int col, int row, str text)
setStringbyName(str name, int row, str text)
setStringbyNameNDate(str name, datetime.datetime day, str text)
sortRowsByDate()

Sort rows by first column

sortRowsByNumber()

Sort rows by first column

sortRowsByString()

Sort rows by first column