2da

class pynwn.TwoDA(source)

2da Files.

__repr__()

Returns repr of the 2da as a string

__str__()

Returns a valid 2da as a string

get(row, col)

Gets a 2da entry by row and column label or column index.

get_column_index(col)

Gets the column index from a column label.

get_float(row, col)

Gets a 2da entry by row and column label or column index as a float.

get_int(row, col)

Gets a 2da entry by row and column label or column index as an int.

parse(content)

Parses a 2da file.

set(row, col, val)

Sets a 2da entry by row and column label or column index. The value passed is automatically coerced to str.

to_ContentObject()

Returns 2da as a ContentObject. It’s .io contents are cStringIO buffer.

to_StringIO()

Returns 2da written in a cStringIO buffer.