IO

class reportree.io.IWriter

IWriter saves an HTML page or a matplotlib figure to a given path. Can be subclassed to allow for storing the reports in distributed storages such as on AWS or GCP.

abstract static write_figure(path: str, figure: Figure)
abstract static write_text(path: str, text: str)
class reportree.io.InjectWriter(pattern='</head>', value='', writer=<class 'reportree.io.LocalWriter'>)

Writer that injects a certain text before a provided pattern in the resulting HTML. Handy for including custom CSS styles, google fonts or other content into head.

write_figure(path: str, figure: Figure)
write_text(path: str, text: str)
class reportree.io.LocalWriter

Default writer that stores pages and images only locally.

static write_figure(path: str, figure: Figure)
static write_text(path: str, text: str)
reportree.io.slugify(value, allow_unicode=False)

Convert to ASCII if ‘allow_unicode’ is False. Convert spaces to hyphens. Remove characters that aren’t alphanumerics, underscores, or hyphens. Convert to lowercase. Also strip leading and trailing whitespace.