Module blob (1.21.0)

Create / interact with Google Cloud Storage blobs.

.. _API reference docs: https://cloud.google.com/storage/docs/ json_api/v1/objects .. _customer-supplied: https://cloud.google.com/storage/docs/ encryption#customer-supplied .. _google-resumable-media: https://googleapis.github.io/ google-resumable-media-python/latest/ google.resumable_media.requests.html

Classes

Blob

Blob(
    name,
    bucket,
    chunk_size=None,
    encryption_key=None,
    kms_key_name=None,
    generation=None,
)

A wrapper around Cloud Storage's concept of an Object.

Parameters
NameDescription
name str

The name of the blob. This corresponds to the unique path of the object in the bucket. If bytes, will be converted to a unicode object. Blob / object names can contain any sequence of valid unicode characters, of length 1-1024 bytes when UTF-8 encoded.

bucket Bucket

The bucket to which this blob belongs.

chunk_size int

The size of a chunk of data whenever iterating (in bytes). This must be a multiple of 256 KB per the API specification.

encryption_key bytes

Optional 32 byte encryption key for customer-supplied encryption. See https://cloud.google.com/storage/docs/encryption#customer-supplied.

kms_key_name str

Optional resource name of Cloud KMS key used to encrypt the blob's contents.