Rows Overview

Here you will find an overview of psv’s objects and methods, but not the objects attributes which are generated dynamically by psv.

Rows

class psv.core.objects.rowobjects.BaseRow(data, *args, **kwargs)

This Base Class represents a row in a spreadsheet

addcolumn(columnname, columndata='')

Adds a column for this row only

construct(*args, **kwargs)

This method can be used by inherited objects of BaseRow as if it was __init__

delcolumn(column)

Delete a cell by the orginal column name

Parameters:column (str) – The column name. Can be both long and short form.
formula(columnname, func, rowref=None, **kwargs)

Replaces a cell with a formula

Parameters:
  • columnname (str) – Name of the column.
  • func (FunctionType) – Function that accepts 1 argument and optionally kwargs.
  • rowref – The referenced row. Defaults to the current row.
  • kwargs – Parameters that will be supplied to the function when ran.
Returns:

Nothing

Return type:

NoneType

getcolumn(column)

Get a cell by the orginal column name

Parameters:column (str) – The column name. Can be both long and short form.
Returns:String of the data, or an int/float if a number/decimal.
Return type:str, int, or float
getformula(columnname)

Get Formula

Parameters:columnname – Gets the result of a formula. Used when

formulas referenced other formulas

longcolumn(columns=None)
Params columns:A collection of columns, if supplied the method will return only the specified columns.
Returns:Generates a dict that uses orginal names of the column.
Return type:dict
outputrow

Returns a boolean of the current output flag for this row

resetflag(to=2)
setcolumn(column, value)

Set a cell by the orginal column name

Parameters:
  • column (str) – The column name. Can be both long and short form.
  • value – The data to be set to the specified column
tabulate(format='grid', only_ascii=True, columns=None, text_limit=None)

Integrates tabulate library with psv

Parameters:
  • format (str) – A valid format for tabulate library.
  • columns – Collection of column names that will be included in the tabulating.
  • text_limit – The number of characters to include per cell.
Only_ascii:

If True, only return ascii characters.