Interface to Google Cloud Storage
Project description
NQGCS
This package offers a pleasant interface to Google Cloud Storage.
Usage:
Create an NQGCS object
form nqgcs import NQGCS
nqgcs = NQGCS(json_key_path="your json key to gcs")
The json key above is not needed on Appengine. The json key is also not needed if you use:
export GOOGLE_APPLICATION_CREDENTIALS="[PATH]"
in the shell.
Access GCS
Upload a file
with open("myfile", "r") as f:
nqgcs.upload("bucket name", "file name", f, type="text/plain")
Write a string to GCS
nqgcs.write("bucket name", "file name", "my content string", type="text/plain")
Read a string from GCS
s = nqgcs.read("bucket name", "file name")
Download a file from GCS
nqgcs.download("bucket name", "file name")
Delete a file, list files
nqgcs.delete("bucket name", "file name")
for f in nqgcs.listfiles("bucket_name", maximum=200):
print("The file name is:", f)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nqgcs-0.1.3.tar.gz
(3.5 kB
view hashes)
Built Distribution
nqgcs-0.1.3-py3-none-any.whl
(3.9 kB
view hashes)