import json from typing import Dict, Any, List from datetime import datetime import plotly.graph_objects as go import plotly.express as px from plotly.offline import plot import plotly import re from utils import safe_pct from benchmarks import BENCHMARKS, badge class ReportGenerator: def __init__(self): self.report_template = self._get_report_template() def _markdown_to_html(self, markdown_text: str) -> str: """Convert simple markdown to HTML""" if not markdown_text: return "" html = markdown_text # Convert headers html = re.sub(r'^### (.*?)$', r'

\1

', html, flags=re.MULTILINE) html = re.sub(r'^## (.*?)$', r'

\1

', html, flags=re.MULTILINE) html = re.sub(r'^# (.*?)$', r'

\1

', html, flags=re.MULTILINE) # Convert bold text html = re.sub(r'\*\*(.*?)\*\*', r'\1', html) # Convert bullet points html = re.sub(r'^- (.*?)$', r'
  • \1
  • ', html, flags=re.MULTILINE) html = re.sub(r'^• (.*?)$', r'
  • \1
  • ', html, flags=re.MULTILINE) # Wrap consecutive
  • tags in