reporting
HTML rendering of financial statements using rich.
Classes:
-
HTMLStatementRenderer–Render structured financial-statement data as HTML using rich.
HTMLStatementRenderer
Render structured financial-statement data as HTML using rich.
Methods:
-
render_balance_sheet–Render a balance sheet as an HTML table.
-
render_income_statement–Render an income statement as an HTML table.
-
render_trial_balance–Render a trial balance as an HTML table.
render_balance_sheet
render_balance_sheet(
data: dict, date: date | str | None = None
) -> str
Render a balance sheet as an HTML table.
Parameters
data:
Dict with keys assets, liabilities, equity (lists of
{"account": str, "balance": float}), plus total_assets,
total_liabilities, total_equity.
date:
Optional statement date shown as a caption.
render_income_statement
render_income_statement(
data: dict, date: date | str | None = None
) -> str
Render an income statement as an HTML table.
Parameters
data:
Dict with keys income, expenses (lists of
{"account": str, "balance": float}), plus total_income,
total_expenses, net_income.
date:
Optional statement date shown as a caption.
render_trial_balance
render_trial_balance(
data: list[dict], date: date | str | None = None
) -> str
Render a trial balance as an HTML table.
Parameters
data:
List of dicts with keys account, debit, credit, balance.
date:
Optional statement date shown as a caption.