Easy to work with Google Cloud Platform Storage Bucket wrapper
Project description
Google Cloud Platform Storage Bucket EaseyBreezey
This package just aims to make life a little bit easier for people who have to work with google cloud storage bucket.
Quickstart:
- get the package
pip install storage-bucket
- Download your keyfile and save it as key.json and point to it with env var:
gcloud iam service-accounts keys create key.json --iam-account your_service_account@your_project.iam.gserviceaccount.com
export GOOGLE_APPLICATION_CREDENTIALS='key.json'
- Run some code:
from storage_bucket.download_file import DownloadFile, download_file
def use_data_for_something(data):
print(data)
# Returns Modal way
downloader = DownloadFile()
downloader(
'my_bucket',
'my_file.txt',
).map(
use_data_for_something, # send data to this function,
).alt(
print, # print error or send a mail or w/e
)
# Normal way, this might throw exception.
my_data = download_file(
'my_bucket',
'my_file.txt',
)
print(my_data)
The use of Returns library.
- Just lets us get rid of all exceptions.
- Lets us chain stuff so everything looks good.
- Lets you use
DownloadFile()(args...).bind(dostuff).alt(dostuffonfailure)
- Don't like it? use the matching normal function provided for your convenience.
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
storage-bucket-0.1.1.tar.gz
(4.4 kB
view hashes)
Built Distribution
Close
Hashes for storage_bucket-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5db21183dc985011722aa21367c14fba2933b46a047713716cc8461b6841fb9e |
|
MD5 | 0d32661d3ede87b4805bd3bde7695e20 |
|
BLAKE2b-256 | e844f3375fe2f20dde20f593fd5a1184eb44533a0489483fd8ae87516607c763 |