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'', 'wb', acl='publicread', consistency='none', block_size=5242880) as f:with, '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.