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_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 details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: nqgcs-0.1.3.tar.gz
  • Upload date:
  • Size: 3.5 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.3.tar.gz
Algorithm Hash digest
SHA256 db0f28997e743be6a1758af657b015f1cee49d54c5f4167462c5e81c1008c942
MD5 cd1f9d0da608a5666b9249df6590f828
BLAKE2b-256 b7928b3e08fc3caedec95cba309eff2fe9420a1a7f7cfbaaadcc997826afb1c5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nqgcs-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b44f89b0ffe8d17a18c01b512355044b9848c23b3ce122c754035092b378588c
MD5 e86404a04bd3c2d19b61ba760d4de67f
BLAKE2b-256 f482e9181e034a2c127e0b0503b7a034291a80ab5be0a18de77f51e212a488b2

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