from pathlib import Path

src = Path("dashboard.template.html")
csv = Path("data/Bank Customer Churn Prediction.csv")

html = src.read_text(encoding="utf-8")
data = csv.read_text(encoding="utf-8")
assert "</script" not in data.lower(), "CSV содержит </script> — встраивание небезопасно"

out = html.replace("__CSV__", data, 1)
Path("dashboard.html").write_text(out, encoding="utf-8")
print("dashboard.html:", len(out.encode("utf-8")), "bytes")
