Skip to content

Reference (Main Report Class)

shirotsubaki.report.Report

Bases: ReportBase

A class for creating a simple report.

Parameters:

  • title (str, default: None ) –

    HTML title (can also be set later)

Example
import shirotsubaki.report
from shirotsubaki.element import Element as Elm

rp = shirotsubaki.report.Report(title='Fruits')
rp.style.set('h1', 'color', 'steelblue')
rp.append(Elm('h1', 'Fruits Fruits'))
rp.append('Fruits Fruits Fruits')
rp.output('docs/example_report.html')

example_report.html

shirotsubaki.report.ReportWithTabs

Bases: ReportBase

A class for creating a report with tabs.

Parameters:

  • title (str, default: None ) –

    HTML title that also serves as the report heading (can also be set later)

Example
import shirotsubaki.report

rp = shirotsubaki.report.ReportWithTabs()
rp.set('title', 'Fruits Fruits Fruits')
rp.add_tab('apple', 'apple apple')
rp.add_tab('banana', 'banana banana')
rp.add_tab('cherry', 'cherry cherry')
rp.output('docs/example_report_with_tabs.html')

example_report_with_tabs.html

add_tab(tabname, content=None)

Add a tab to the report.

Parameters:

  • tabname (str) –

    The name of the tab (this will be displayed on the tab)

  • content (str | Element, default: None ) –

    The content to be placed in the tab (can also be added later)

shirotsubaki.report.ReportBase

Bases: ABC

output(out_html, verbose=True)

Output the report.

Parameters:

  • out_html (str) –

    Path to the output file

  • verbose (bool, default: True ) –

    Whether to print the output file path and file size to stdout