title: Convert CSV file to JSON with python
body: <p>I am trying to covert my CSV email list to a JSON format to mass email via API. This is my code thus far but am having trouble with the output. Nothing is outputting on my VS code editor.</p>
  <pre><code>import csv
  import json
  
  
  def make_json(csvFilePath, jsonFilePath):
  
      data = {}
  
      with open(csvFilePath, encoding='utf-8') as csvf:
          csvReader = csv.DictReader(csvf)
  
          for rows in csvReader:
  
              key = rows['No']
              data[key] = rows
  
      with open(jsonFilePath, 'w', encoding='utf-8') as jsonf:
          jsonf.write(json.dumps(data, indent=4))
  
  
  csvFilePath = r'/data/csv-leads.csv'
  jsonFilePath = r'Names.json'
  
  make_json(csvFilePath, jsonFilePath)
  </code></pre>
  <p>Here is my desired JSON format</p>
  <pre><code>  {
          &quot;EmailAddress&quot;: &quot;hello@youngstowncoffeeseattle.com&quot;,
          &quot;Name&quot;: &quot;Youngstown Coffee&quot;,
          &quot;ConsentToTrack&quot;: &quot;Yes&quot;
      },
  </code></pre>
  <p>Heres my CSV list</p>
  <pre><code>No,EmailAddress,ConsentToTrack
  Zylberschtein's Delicatessen &amp; Bakery,catering@zylberschtein.com,Yes
  Youngstown Coffee,hello@youngstowncoffeeseattle.com,Yes
  </code></pre>