NQGCS
This package offers a pleasant interface to Google Cloud Storage.
Usage:
Create an NQGCS object
There are three ways. On Appengine, you can do simply:
from nqgcs import NQGCS
nqgcs = NQGCS()
You can do the above also if you use:
export GOOGLE_APPLICATION_CREDENTIALS="[PATH]"
Otherwise, you can use a json key file. You can either pass the path to the file:
from nqgcs import NQGCS
nqgcs = NQGCS(json_key_path="your json key to gcs")
Or you can pass the file content, read via json:
from nqgcs import NQGCS
nqgcs = NQGCS(keys=keys)
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)
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.4.tar.gz
(3.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
nqgcs-0.1.4-py3-none-any.whl
(4.1 kB
view details)
File details
Details for the file nqgcs-0.1.4.tar.gz.
File metadata
- Download URL: nqgcs-0.1.4.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c48f8f3d0dbd21251484756dfd5e10b958655c39e5a9a0d98a679b95f9e9fdd0
|
|
| MD5 |
91fa1b9b8eea8e8f533bea1ecc4db5d3
|
|
| BLAKE2b-256 |
84fbe675f2a6619faa9bf731b7ace2aa0f63e4a3070c617236108ea108155fcb
|
File details
Details for the file nqgcs-0.1.4-py3-none-any.whl.
File metadata
- Download URL: nqgcs-0.1.4-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
862b83b130953453b2006cb054628ea78ea366d6cda5ef513fafcb9470181b51
|
|
| MD5 |
b85d7b24fdc4e970750896c31a6300b6
|
|
| BLAKE2b-256 |
67e58f7007d88f92707d06e57f1ed202ed8c93dee5047379407cc121b1406526
|