Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Google Cloud Storage client in Python check CRC (or MD5) automatically?

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.

like image 731
Kevin Avatar asked Oct 07 '18 08:10

Kevin


People also ask

What is GCS client?

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.

How do I know if Crcmod is installed?

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.


1 Answers

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

like image 56
Frank Natividad Avatar answered Sep 26 '22 00:09

Frank Natividad