-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storage: Add method(s) to parse gs://bucket_name
and gs://bucket_name/path/to/blob
URIs
#7693
Comments
CC @frankyn |
Hi @tswast, What do you think about, instead? client.blob_from_uri("gs://bucket/object")
client.bucket_from_uri("gs://bucket") The design I'd prefer the method be attached to the client in this case. |
@frankyn I like your proposal. I proposed |
Blob.from_string
classmethod to parse gs://bucket_name/path/to/blob
URLsgs://bucket_name
and gs://bucket_name/path/to/blob
URIs
@frankyn I don't quite see why hanging the method off the client makes things any clearer. We already have a pattern in other client libs of using Python |
It would be very convenient if we could take a string such as
gs://bucket_name/path/to/blob
and download the content for it.I propose we add a
Blob.from_string
classmethod, similar to BigQuery'sTableReference.from_string
method.Since the
Blob
class requires a client object (via Bucket) to support downloads, I suggest bothpath
andclient
are required arguments forBlob.from_string(path, client)
.The text was updated successfully, but these errors were encountered: