pickling python objects to google cloud storage

前端 未结 3 1165
南方客
南方客 2021-01-20 08:22

I\'ve been pickling the objects to filesystem and reading them back when needed to work with those objects. Currently I\'ve this code for that purpose.

def p         


        
3条回答
  •  北荒
    北荒 (楼主)
    2021-01-20 09:04

    You can use the Cloud Storage client library.

    Instead of open() use cloudstorage.open() (or gcs.open() if importing cloudstorage as gcs, as in the above-mentioned doc) and note that the full filepath starts with the GCS bucket name (as a dir).

    More details in the cloudstorage.open() documentation.

提交回复
热议问题