def METHOD_NAME(self, path: str) -> None:
    # Always keep a backup file around
    if os.path.exists(path):
        shutil.copy(path, f"{path}.bak")
    with open(path, "w", encoding="utf-8-sig", newline='') as file:
        writer = csv.DictWriter(file, fieldnames=PromptStyle._fields)
        writer.writeheader()
        writer.writerows(style._asdict() for k, style in self.styles.items())