Skip to content

Commit 7101f47

Browse files
authored
docs: clarify prefixes entity in list_blobs and link sample (#837)
Improve documentation as part of 294 - clarify `prefixes` entity exists as part of the response - add link to sample broswer ["List the objects in a bucket using a prefix filter"](https://cloud.google.com/storage/docs/samples/storage-list-files-with-prefix#storage_list_files_with_prefix-python) Fixes #294 🦕
1 parent 4c92a9a commit 7101f47

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

google/cloud/storage/client.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -1271,14 +1271,14 @@ def list_blobs(
12711271
Iterator of all :class:`~google.cloud.storage.blob.Blob`
12721272
in this bucket matching the arguments.
12731273
1274-
Example:
1275-
List blobs in the bucket with user_project.
1274+
As part of the response, you'll also get back an iterator.prefixes entity that lists object names
1275+
up to and including the requested delimiter. Duplicate entries are omitted from this list.
12761276
1277-
>>> from google.cloud import storage
1278-
>>> client = storage.Client()
1277+
.. note::
1278+
List prefixes (directories) in a bucket using a prefix and delimiter.
1279+
See a [sample](https://cloud.google.com/storage/docs/samples/storage-list-files-with-prefix#storage_list_files_with_prefix-python)
1280+
listing objects using a prefix filter.
12791281
1280-
>>> bucket = storage.Bucket(client, "my-bucket-name", user_project="my-project")
1281-
>>> all_blobs = list(client.list_blobs(bucket))
12821282
"""
12831283
bucket = self._bucket_arg_to_bucket(bucket_or_name)
12841284

0 commit comments

Comments
 (0)