title: How to list S3 bucket Delimiter paths
body: <p><strong>How to list S3 bucket Delimiter paths?</strong></p>
  
  <p>Basically I want to list all of the "directories" and or "sub-directories" in a s3 bucket. I know these don't physically exist. Basically I want all the objects that contain the delimiter and then only return the key path before for the delimiter. Starting under a prefix would be even better but at the bucket level should be enough.</p>
  
  <p>Example S3 Bucket:</p>
  
  <pre><code>root.json
  /2018/cats/fluffy.png
  /2018/cats/gary.png
  /2018/dogs/rover.png
  /2018/dogs/jax.png
  </code></pre>
  
  <p>I would like to then do something like:</p>
  
  <pre><code>s3_client = boto3.client('s3')
  s3_client.list_objects(only_show_delimiter_paths=True)
  </code></pre>
  
  <p>Result</p>
  
  <pre><code>/2018/
  /2018/cats/
  /2018/dogs/
  </code></pre>
  
  <p>I don't see any way to do this natively using: <a href="https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#S3.Client.list_objects" rel="nofollow noreferrer">https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#S3.Client.list_objects</a></p>
  
  <p>I could pull all the object names and do this in my application code but that seems inefficient.  </p>