I have tried to find out if GCS Python client, and more specifically, blob.upload_from_file()
and blob.download_to_file()
check integrity of the uploaded or downloaded file automatically. If not, how can I check the CRC hash programmatically? Any pointers to documentation or source code would be appreciated.
ExpanDrive is a fast and powerful client for Google Cloud Storage and runs on macOS, Windows and Linux. It can map a drive directly to a bucket on GCS and also has a full cloud storage browser and uploader that lets you manage your storage.
To determine if the compiled version of crcmod is available in your Python environment, you can inspect the output of the gsutil version command for the "compiled crcmod" entry: $ gsutil version -l ... compiled crcmod: True ... If your crcmod library is compiled to a native binary, this value will be True.
Edit(06/29/22) Checksums in Python are now available for md5 and crc32c for uploads and downloads.
For example: Blob.download_as_bytes() has a new parameter named checksum with three values (None, 'md5', 'crc32c') https://googleapis.dev/python/storage/latest/blobs.html#google.cloud.storage.blob.Blob.download_as_bytes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With