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.1.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.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nqgcs-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 6472b6f5ceca9a9ea989e8e73abf23d33f41b3219a6bab7fe2705e3a7db32d3e
MD5 e22ce4bf35daaafd722e72fa8338b3e4
BLAKE2b-256 2209226d6214647d1b5f2182d156b92d9add6ecf3a88948bc8657137e4d90dfd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nqgcs-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 00c979bf444d142453f4c11ee84be2d48064721a2bdeec2f4e4d9f14bec33b6e
MD5 a4de9642856eb8bc606ee36b58285b8d
BLAKE2b-256 027a1c344326a6131899e587d322182f22d2848b34295245c47cea296568c8fe

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