Cloud Storage Write Streaming Data (Upload Data by Chunks)

Solution 1: gcsfs

gcsfs is a 3rd party library (not by Google)

import gcsfsfs = gcsfs.GCSFileSystem(token='keys/travelopyz-appengine.json')BUCKET_NAME = '...'filename = f"{BUCKET_NAME}/DIRECTORY_NAME/test_file.txt"# with gcsfs.core.GCSFile(fs, f'travelopyz.appspot.com/generate/get_items_test/test_file4', 'wb', acl='publicread', consistency='none', block_size=5242880) as f:with fs.open(filename, 'wb', acl='publicread') as f:    f.write('Item 1'.encode())    f.write('Item 2'.encode())

NOTE: acl - publicread doesn't seems to work, checking the source code would note that the acl args is not used. I tried using GCSFile and acl doesn't seems to work as well.

Solution 2: google-resumable-media

I have yet to try this, but following are some relevant resources.

Solution 3: google-cloud-storage

There is a request issue raised.

The source code has some hint/potential for resumable multipart upload.

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.