title: Python CSV writer to quote strings with extra spaces
body: <p>My data looks something like this:</p>
  
  <pre><code>data = [
    [" trailing space", 19, 100],
    [" ", 19, 100],
  ]
  
  writer = csv.writer(csv_filename, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
  </code></pre>
  
  <p>Output</p>
  
  <pre><code> trailing space,19,100
   ,19,100
  </code></pre>
  
  <p>What I want</p>
  
  <pre><code>" trailing space",19,100
  " ",19,100
  </code></pre>
  
  <p>Python default CSV writer has the option to "QUOTE_MINIMAL" but it doesn't include quoting strings with extra spaces in it. In my case, those empty spaces are actually critical, but without quoting, the reader (like libre-office) strips the spaces if not quoted.</p>
  
  <p>Is there any built in options or quick cheap way to tell the writer to quote empty strings with spaces?</p>
  
  <p>Also, "QUOTE_NONNUMERIC" is quoting too much. The actual data is huge ( few hundred megabytes with 60% - 70% of strings). It may sounds silly, but I'm trying to reduce the csv size by minimizing the quotes.</p>