Skip to content
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

Clarify documentation on retrieving md5 and/or crc32c hash for blobs without downloading #54

Closed
tcwalther opened this issue Feb 12, 2020 · 0 comments · Fixed by #75
Closed
Assignees
Labels
api: storage Issues related to the googleapis/python-storage API. documentation Improvements or additions to documentation type: docs Improvement to the documentation for an API.

Comments

@tcwalther
Copy link

tcwalther commented Feb 12, 2020

Update: Just briefly after posting the issue, I found out how to do it. I'm thus recommending to update the documentation to clarify how to do this.

If I understand it correctly, retrieving a blob's md5 or crc32c hash without downloading it requires calling reload():

>>> blob = bucket.blob("gs://some/url")
>>> blob.crc32c
None
>>> blob.reload()
>>> blob.crc32c
'quMJjg=='

It took me almost an hour to find that out, including browsing the documentation, browsing SO, cloning the source and having a look around there. Eventually I found this SO post which implied that blob.crc32c actually works, and then using tab-completion trial-and-error in ipython I found the reload() method.

I think it would be great if the documentation clarified this :-).

Use Case

Checking whether a remote file needs to be downloaded when a local file of the same filename already exists.

@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/python-storage API. label Feb 12, 2020
@tcwalther tcwalther changed the title Support retrieving md5 and/or crc32c hash for blobs without downloading Clarify documentation on retrieving md5 and/or crc32c hash for blobs without downloading Feb 12, 2020
@frankyn frankyn added documentation Improvements or additions to documentation type: docs Improvement to the documentation for an API. labels Feb 12, 2020
@HemangChothani HemangChothani self-assigned this Feb 20, 2020
cojenco pushed a commit to cojenco/python-storage that referenced this issue Oct 13, 2021
cojenco pushed a commit to cojenco/python-storage that referenced this issue Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/python-storage API. documentation Improvements or additions to documentation type: docs Improvement to the documentation for an API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants