dwh_auditor.reporter — Audit result output/report generation layer

The dwh_auditor.reporter package formats and outputs the AuditResult object generated by Analyzer into a format that is easy for users to reference (terminal/Markdown file).


Console output (reporter.console)

Use the Rich library to output to the terminal in a colored table format.

Usage example:

from dwh_auditor.reporter.console import print_to_console
from dwh_auditor.models.result import AuditResult

result: AuditResult = ...  # Received from Analyzer
print_to_console(result)

Console output layer (rich CLI output using Rich).

dwh_auditor.reporter.console.print_to_console(result)[source]

Display AuditResult richly in the terminal.

Parameters:

result (AuditResult) – Audit results received from Analyzer

Return type:

None


Markdown report generation (reporter.markdown)

Generate report.md. This format is suitable for saving as an artifact in a CI/CD pipeline or automatically posting to an internal wiki.

Usage example:

from dwh_auditor.reporter.markdown import generate_markdown_report

generate_markdown_report(result, filepath="audit_report.md")

Markdown report generation layer.

dwh_auditor.reporter.markdown.generate_markdown_report(result, filepath='report.md')[source]

Output AuditResult as a Markdown format report file.

It is intended to be saved as a CI/CD artifact or pasted into an internal wiki. Contains business leads at the end.

Parameters:
  • result (AuditResult) – Audit results received from Analyzer

  • filepath (str) – Output destination file path (default: “report.md”)

Return type:

None


JSON レポート生成 (reporter.json_out)

システム連携・二次解析用の JSON 形式で監査結果を出力します。 jq 等でのパースや、ダッシュボードへの直接取り込みに適しています。

Usage example:

from dwh_auditor.reporter.json_out import generate_json_report

json_str = generate_json_report(result)
print(json_str)

JSON フォーマットの出力層.

dwh_auditor.reporter.json_out.generate_json_report(result)[source]

AuditResult を JSON 文字列に変換する.

CI/CD ツール等での利用を想定し、標準出力にそのまま渡せる形式で出力する。

Parameters:

result (AuditResult)

Return type:

str