Skip to main content

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="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.2.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nqgcs-0.1.2-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file nqgcs-0.1.2.tar.gz.

File metadata

  • Download URL: nqgcs-0.1.2.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

Hashes for nqgcs-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e2a6ddb21ce88faa134169aa5e173671960cba2f213ed76727fde1c642b78768
MD5 365e2e86405618e788148b153bd40d84
BLAKE2b-256 54a79328f4e5fd835f3aa222ff7b516d38043f42ce4efc88c0e17de6929525c6

See more details on using hashes here.

File details

Details for the file nqgcs-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: nqgcs-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.9 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

Hashes for nqgcs-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e5152d5b77c44a904f2ecd4874c802ecaa703c60c837e0514d26c550bd0c4829
MD5 77b7a5fd9cab4722b725282c26154f16
BLAKE2b-256 92a2314b131b7d4b11b4850be0c5a5f557c4c0cdbfbc0b12bb022a3cbbe5003d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page