Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



Migrating from the Google Cloud Storage API

If your code currently uses the Google Cloud Storage API , the migration to the GCS client library is straightforward, as the client library supports very similar functionality. The one exception is bulk deletes, which are only available in the Google Cloud Storage API. The client library does not support bulk deletes. Instead, you will need to specify each file to be deleted in a separate call.

The following table compares the functionality provided by the deprecated Files API and the new client library:

Feature Cloud Storage API Client Library Differences
Distribution google.appengine.api.files package in the SDK. Download the library into your project. client-side only library
Imports from google.appengine.api import files import cloudstorage
Create files.gs.create() No longer needed. Client library combines create/open in one call, cloudstorage.open() .
Open files.open() cloudstorage.open() supports everything in old open.
List bucket Contents files.listdir() cloudstorage.listbucket Same options and behavior; cloudstorage.listbucket() returns an iterator object, GCSFileStat . However, the new listbucket also has a directory emulation mode.
Delete File files.delete() cloudstorage.delete() Client library doesn't support bulk deletes.
File metadata None cloudstorage.stat() Client library returns last-modified time, header-length, content type for the specified file.
Read/write/tell/seek/close files.File.write() , files.File.read() , files.File.tell() , files.File.seek() , files.File.close() Standard Python write , read , tell , seek , and close . Direct replacement.
Finalize files.File.finalize() No longer needed. (Standard Python close finalizes the file.)
Buffering BufferedFile() class "Built-in" buffering Client library buffers all reads, and includes a prefetch buffer that gets filled while your app processes from the read buffer.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.