Skip to main content
def download_object(
    gcs_uri: str,
    *,
    api_key: Optional[str] = None,
) -> bytes:

source code

Download a GCS object’s content as bytes.Retrieves the content of a Google Cloud Storage object and returns it as raw bytes. Arguments:
  • gcs_uri - The GCS URI of the object (e.g., “gs://bucket-name/path/to/object”).
  • api_key - If specified, unify API key to be used. Defaults to the value
Returns: The raw bytes content of the object. Raises:
  • RequestError: If the request fails (e.g., object not found, invalid URI).