tessl install tessl/pypi-gcloud@0.7.0Python client library for Google Cloud Platform services including Datastore, Storage, and Pub/Sub
Agent Success
Agent success rate when using this tile
93%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.19x
Baseline
Agent success rate without this tile
78%
Build a utility that manages blob uploads and metadata in Google Cloud Storage.
Your task is to implement a blob metadata manager that:
The implementation should handle:
@generates
class BlobManager:
"""Manages blob uploads and metadata in Google Cloud Storage."""
def __init__(self, project_id: str, bucket_name: str):
"""
Initialize the blob manager.
Args:
project_id: Google Cloud project ID
bucket_name: Name of the storage bucket
"""
pass
def upload_with_metadata(self, blob_name: str, content: str,
metadata: dict = None, content_type: str = None,
cache_control: str = None) -> None:
"""
Upload string content to a blob with optional metadata and properties.
Args:
blob_name: Name of the blob to create
content: String content to upload
metadata: Optional dictionary of custom metadata key-value pairs
content_type: Optional content type (e.g., "text/plain")
cache_control: Optional cache control directive
"""
pass
def download_blob(self, blob_name: str) -> str:
"""
Download blob content as a string.
Args:
blob_name: Name of the blob to download
Returns:
Blob content as string
"""
pass
def get_metadata(self, blob_name: str) -> dict:
"""
Retrieve custom metadata from a blob.
Args:
blob_name: Name of the blob
Returns:
Dictionary of custom metadata key-value pairs
"""
pass
def get_properties(self, blob_name: str) -> dict:
"""
Retrieve blob properties including content type and cache control.
Args:
blob_name: Name of the blob
Returns:
Dictionary with 'content_type' and 'cache_control' keys
"""
pass
def update_metadata(self, blob_name: str, metadata: dict) -> None:
"""
Update metadata on an existing blob without modifying content.
Args:
blob_name: Name of the blob
metadata: Dictionary of metadata key-value pairs to set
"""
passProvides Google Cloud Storage client for blob operations.
@satisfied-by