From the course: Data Science on Google Cloud Platform: Exploratory Data Analytics

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Writing to buckets

Writing to buckets - Google Cloud Tutorial

From the course: Data Science on Google Cloud Platform: Exploratory Data Analytics

Start my 1-month free trial

Writing to buckets

- [Instructor] Let's see how we can quickly write the contents of a Python variable into an object on Cloud Storage. First, you have to create a text variable. In this case, I call it write text. Let's make the content something descriptive. String like testing for GS writes. We use the write option in the GCS command line to write the contents of this object. We specify the variable to read from using the variable option and also the object to write them using the object option. Then, we will try do the same thing with the SDK. We create a write bucket object with the bucket name. We then create a write object variable with the full object path inside the write bucket. We write to that object using the write stream function. We will now go to the cloud storage dashboard and check out the results of all our operations. We see that there are two new buckets created based on our create commands using the command line and the SDK. If you go inside the test, kumaran hyphen two, zero, one,…

Contents