IPython Usage

IPython Usage#

Because, in an IPython environment, code can be run and rerun in an arbitrary order, the same frames added to a Tablate class instance using the .add_text_frame(), .add_grid_frame and .add_table_frame() methods can be added multiple times in an undesired manner.

There are two ways to get around this.

The first way is to name the frame using the name argument. This causes a named frame to overwrite any frame with the same name. Therefore a named framed can be added any number of times and in any order after the frame has initially been added and the frame will simply overwrite (and update) itself each time.

tab.add_text_frame("Some text...", name="text_frame_1")

The second way is create a set of TablateItem frames using the Text, Grid and Table classes and then merge them using the concat function. This will return a new TablateSet instance with the merged TablateItem frames. This can be done any number of times and will always return the same merged TablateSet.

tab = concat([text_frame, grid_frame, table_frame])

Additionally, the concat function accepts container and global default styling options.