Question: I'm going to write a Python program to check if a file is in certain folder of my Google Cloud Storage, the basic idea is to get the `list` of all objects in a folder, a file name `list`, then check if the file `abc.txt` is in the file name `list`.

Now the problem is, it looks Google only provide the one way to get `obj` `list`, which is `uri.get_bucket()`, see below code which is from <https://developers.google.com/storage/docs/gspythonlibrary#listing-objects>

```
uri = boto.storage_uri(DOGS_BUCKET, GOOGLE_STORAGE)
for obj in uri.get_bucket():
    print '%s://%s/%s' % (uri.scheme, uri.bucket_name, obj.name)
    print '  "%s"' % obj.get_contents_as_string()

```

The defect of `uri.get_bucket()` is, it looks it is getting all of the object first, this is what I don't want, I just need get the `obj` name `list` of particular folder(e.g `gs//mybucket/abc/myfolder`) , which should be much quickly.

Could someone help answer? Appreciate every answer!

Answer: 
This worked for me:

```
client = storage.Client()
BUCKET_NAME = 'DEMO_BUCKET'
bucket = client.get_bucket(BUCKET_NAME)

blobs = bucket.list_blobs()

for blob in blobs:
    print(blob.name)

```

The list\_blobs() method will return an iterator used to find blobs in the bucket.
Now you can iterate over blobs and access every object in the bucket. In this example I just print out the name of the object.

This documentation helped me alot:

* <https://googleapis.github.io/google-cloud-python/latest/storage/blobs.html>
* <https://googleapis.github.io/google-cloud-python/latest/_modules/google/cloud/storage/client.html#Client.bucket>

I hope I could help!
Install python package google-cloud-storage by pip or pycharm and use below code

```
from google.cloud import storage
client = storage.Client()
for blob in client.list_blobs(BUCKET_NAME, prefix=FOLDER_NAME):
  print(str(blob))

```