title: Reading multiple csv files from S3 bucket with boto3
body: <p>I need to read multiple csv files from S3 bucket with boto3 in python and finally combine those files in single dataframe in pandas. </p>
  
  <p>I am able to read single file from following script in python</p>
  
  <pre><code> s3 = boto3.resource('s3')
   bucket = s3.Bucket('test-bucket')
   for obj in bucket.objects.all():
      key = obj.key
      body = obj.get()['Body'].read()
  </code></pre>
  
  <p>Following is my path</p>
  
  <pre><code> files/splittedfiles/Code-345678
  </code></pre>
  
  <p>In <code>Code-345678</code> I have multiple <code>csv</code> files which I have to read and combine it to single dataframe in pandas</p>
  
  <p>Also, how do I pass a list of selected <code>Codes</code> as a list,so that it will read those folders only.  e.g.</p>
  
  <pre><code>files/splittedfiles/Code-345678
  files/splittedfiles/Code-345679
  files/splittedfiles/Code-345680
  files/splittedfiles/Code-345681
  files/splittedfiles/Code-345682
  </code></pre>
  
  <p>From above I need to read files under following codes only. </p>
  
  <pre><code>345678,345679,345682
  </code></pre>
  
  <p>How can I do it in python?</p>