title: How to exclude list of file names or file types when getting list of objects from boto3?
body: <p>I want to exclude 3 files by name and/or open to excluding them by file type (All 3 files end in <code>.csv</code>) when I make a call with boto3 to get a list of objects in a s3 bucket. </p>
  
  <p>Currently I am listing all objects like so:</p>
  
  <pre><code>import boto3
  
  s3 = boto3.client('s3')
  
  objs = s3.list_objects_v2(Bucket='mybucket_name')['Contents']
  </code></pre>
  
  <p>But not sure how to filter out the files or <code>.csv</code> at this point. How can I filter out file names or file extension from the <code>objs</code> variable ideally? I have this piece of code ready to get the file name of the lastest modified file:</p>
  
  <pre><code>last_added = [obj['Key'] for obj in sorted(objs, key=get_last_modified)][-1]
  </code></pre>
  
  <p>However I can get a list of file names that <strong>dont have</strong> '.csv' (in this case the files not have any extensions) file type ,like so:</p>
  
  <pre><code>s3 = boto3.resource('s3')
  my_bucket = s3.Bucket('bucket_name')
  files = my_bucket.objects.all()
  file_list = []
  for file in files:
      if file.key.endswith(''):
           file_list.append(file.key)
  </code></pre>
  
  <p>This doesnt tell me the last modified date however.  </p>