cave.html.html_helpers module

cave.html.html_helpers._split_table(table: collections.OrderedDict)[source]

Splits an OrderedDict into a list of tuples that can be turned into a HTML-table with pandas DataFrame

Parameters

table (OrderedDict) – table that is to be split into two columns

Returns

table_split – list with two key-value pairs per entry that can be used by pandas df.to_html()

Return type

List[tuple(key, value, key, value)]

cave.html.html_helpers.figure_to_html(figure, prefix=None, max_in_a_row=None, true_break_between_rows=False)[source]

Turns filepaths to nice html-figures

Parameters
  • figure (Union[List[str], str]) – path or list of paths

  • prefix (Union[None, str]) – if set, the length of this string will be clipped from beginning

  • max_in_a_row (Union[None, int]) – if set, insert a break after this many plots

  • true_break_between_rows (bool) – if False, a simple <br> tag will be set between the rows, if True, will insert div-end tags

Returns

html – html-code or list with independent html-codes

Return type

Union[str, List[str]]