Reports¶
write_reports and render_html.
Standard library only.
write_reports¶
result¶
dict, required
The dict returned by run_audit.
out_dir¶
str | Path, required
Directory to write into. Created with parents if missing.
Returns (json_path, html_path), pointing at report.json and report.html.
JSON is written with two space indentation and ensure_ascii=False, encoded as UTF8.
render_html¶
Returns the full HTML document as a string, without writing to disk. Useful for embedding in a notebook or a web service.
from IPython.display import HTML
from modeldiffr.report import render_html
HTML(render_html(result))
All user and model text is escaped. The page has no external assets and supports light and dark color schemes.
Rerendering an old report¶
The HTML is derived entirely from the JSON, so you can rebuild it at any time: