From 980494a782df875f2ec2b5eea11b2049987b39eb Mon Sep 17 00:00:00 2001 From: Jeremy Singer-Vine Date: Mon, 10 Feb 2025 21:54:10 -0500 Subject: [PATCH] Use csv.QUOTE_MINIMAL for .to_csv(...) --- pdfplumber/container.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pdfplumber/container.py b/pdfplumber/container.py index 2d664fe..4793655 100644 --- a/pdfplumber/container.py +++ b/pdfplumber/container.py @@ -170,7 +170,9 @@ class Container(object): cols = CSV_COLS_REQUIRED + list(filter(serializer.attr_filter, non_req_cols)) - w = csv.DictWriter(stream, fieldnames=cols, extrasaction="ignore") + w = csv.DictWriter( + stream, fieldnames=cols, extrasaction="ignore", quoting=csv.QUOTE_MINIMAL + ) w.writeheader() w.writerows(serialized)