title: Read data from a CSV file in S3 bucket and store it in a dictionary in python
body: <p>I am trying to read a csv file from S3 bucket and store its content into a dictionary. 
  Sample csv file data. I want to use my first row as key and subsequent rows as value.</p>
  
  <pre><code>name,origin,dest
  xxx,uk,france
  yyyy,norway,finland
  zzzz,denmark,canada
  </code></pre>
  
  <p>I am using the below code which is storing the entire row in a dictionary. But I want to loop through each row and store each field in a row as key value pair. </p>
  
  <p>{'name':'xxx','origin':'uk','dest':'france'}</p>
  
  <pre><code>s3 = boto3.client('s3')
  obj = s3.get_object(Bucket = 'bucket_name', Key = 'logs/log.csv')
  lines = obj['Body'].read().decode("utf-8").replace("'", '"')
  lines = lines.splitlines()
  if (isinstance(lines, str)):
          lines = (lines)
  
  docData = {}
  for line in lines:
          docData['content'] = str(line)
  
  print(docData)
  </code></pre>