Python Client for Google Cloud Storage
Project description
This is a shared codebase for gcloud-aio-storage and gcloud-rest-storage
Installation
$ pip install --upgrade gcloud-{aio,rest}-storage
Usage
To upload a file, you might do something like the following:
import aiohttp
from gcloud.aio.storage import Storage
async with aiohttp.ClientSession() as session:
client = Storage(session=session)
async with open('/path/to/my/file', mode='r') as f:
status = await client.upload('my-bucket-name',
'path/to/gcs/folder',
f.read())
print(status)
Note that there are multiple ways to accomplish the above, ie,. by making use of the Bucket and Blob convenience classes if that better fits your use-case.
You can also refer smoke test for more info and examples.
Contributing
Please see our contributing guide.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gcloud-aio-storage-5.2.2.tar.gz
(11.4 kB
view hashes)
Built Distribution
Close
Hashes for gcloud_aio_storage-5.2.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d967d64426383581e1a047e9d1f292341e2f3a1ee23224f7c8b89c1d55ca9df7 |
|
MD5 | e7cb286e6c7676c70355b5b103056892 |
|
BLAKE2b-256 | ab22239d1489588257f515fa45a65dac654820444469187c830fabe551c18792 |