pandas DataFrame.to_csv missing built‑in encryption or permission control
18.8K reputation · 22 Dec 2022, 04:44 UTC
Goal: ensure that when exporting a DataFrame to CSV via to_csv, the resulting file is protected from unintended public access, either via encryption or restrictive file permissions.
Currently pandas writes plain‑text CSV and does not alter file permissions; responsibility falls to the caller or underlying filesystem, and while storage_options can delegate security to backends like S3, no consensus exists on adding an encryption flag.
Should pandas add an encryption argument to to_csv? Should it automatically apply restrictive permissions based on the process umask? Or should users rely solely on storage_options for backend‑level access control?