from pathlib import Path from typing import List def generate_html(ids: List[str], path: Path): def generate_entry(certificate_id: str) -> str: return f""" {certificate_id} """ html_head = """ Cryptographic Module Validation Program | CSRC """ rows = "" for cert_id in ids: rows += f"\n{generate_entry(cert_id)}\n" html_body = f""" {rows}
Certificate Number Vendor Name Module Name Module Type Validation Date
""" with open(path, "w") as f: f.write(f"{html_head}\n{html_body}\n")