ranklens.report¶
ranklens.report
¶
Reports: a complete HTML or Markdown file, written atomically.
AtomicReport
¶
with AtomicReport(path) as fh: fh.write(...) — all of it or nothing.
Source code in src/ranklens/report/atomic.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
Section
dataclass
¶
table is a list of rows with the same keys; figure a plotly Figure.
Source code in src/ranklens/report/sections.py
10 11 12 13 14 15 16 17 | |
render_html
¶
render_html(title: str, sections: Sequence[Section]) -> str
The whole document as a string.
Source code in src/ranklens/report/html.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
write_html
¶
write_html(
path: str | Path,
title: str,
sections: Sequence[Section],
) -> None
Render and write atomically: the file is the old one or the complete new one.
Source code in src/ranklens/report/html.py
55 56 57 58 59 | |
write_report
¶
write_report(
path: str | Path,
title: str,
sections: Sequence[Section],
) -> None
HTML for .html/.htm, Markdown for .md; anything else is an error.
Source code in src/ranklens/report/__init__.py
22 23 24 25 26 27 28 29 30 | |