Google Doodle: Desi Arnaz

Today’s Google Doodle celebrates Desi Arnaz, best known as playing Ricky Ricardo in the TV show I Love Lucy. Here’s how the Google page looked like with the doodle:

The doodle itself:

Clicking on the doodle links you to a search for Desi Arnaz:

Clicking on the link to explore the life of Desi Arnaz brings you to a Google Arts & Culture article:

Listing Files Within A Bucket Folder – Python

Here’s a short code example in Python to iterate through a folder’s ( thisisafolder ) contents within Google Cloud Storage (GCS). Each filename can be accessed through blobi.name – in the below code sample, we print it out and test whether it ends with .json.

Remember that folders don’t actually exist on GCS, but a folder-like structure can be created by prefixing filenames with the folder name and the forward slash character ( / ).

    client = storage.Client()
    bucket = client.get_bucket("example-bucket-name")
    blob_iterator = bucket.list_blobs(prefix="thisisafolder",client=client)
    #iterate through and print out blob filenames
    for blobi in blob_iterator:
        print(blobi.name)
        if blobi.name.endswith(".json"):
            #do something with blob that ends with ".json"