Skip to main content

A stub emulator for the Google Cloud Storage API

Project description

Local Emulator for Google Cloud Storage

Google doesn't (yet) ship an emulator for the Cloud Storage API like they do for Cloud Datastore.

This is a stub emulator so you can run your tests and do local development without having to connect to the production Storage APIs.

THIS IS A WORK IN PROGRESS AND ONLY SUPPORTS A LIMITED SUBSET OF API

CLI Usage

Starting the emulator

Start the emulator with:

$ gcloud-storage-emulator start --port=9090

By default, data is stored under $PWD/.cloudstorage. You can configure the folder using the env variables STORAGE_BASE and STORAGE_DIR.

If you wish to run the emulator in a testing environment or if you don't want to persist any data, you can use the --no-store-on-disk parameter. For tests, you might want to consider starting up the server from your code (see the Python APIs)

Wiping data

You can wipe the data by running

$ gcloud-storage-emulator wipe

Python APIs

To start a server from your code you can do

from gcloud_storage_emulator.server import create_server

server = create_server("localhost", 9023, in_memory=False)

server.start()
# ........
server.stop()

You can wipe the data (e.g. for text execution) by calling server.wipe()

This can also be achieved (e.g. during tests) by hitting the /wipe endpoint

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

gcloud-storage-emulator-0.0.0.dev10.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

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

gcloud_storage_emulator-0.0.0.dev10-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file gcloud-storage-emulator-0.0.0.dev10.tar.gz.

File metadata

  • Download URL: gcloud-storage-emulator-0.0.0.dev10.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for gcloud-storage-emulator-0.0.0.dev10.tar.gz
Algorithm Hash digest
SHA256 8aa92ae1431c8f604e89896e0b2057852a23746eee06a2c202fe1987b58b8d93
MD5 b6fb17faa94ccbb178e723d1ebe3a321
BLAKE2b-256 aeadf8be927804a7d49b87b7a5fb4886127a605e142c688dc48b790ba5c493dd

See more details on using hashes here.

File details

Details for the file gcloud_storage_emulator-0.0.0.dev10-py3-none-any.whl.

File metadata

  • Download URL: gcloud_storage_emulator-0.0.0.dev10-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for gcloud_storage_emulator-0.0.0.dev10-py3-none-any.whl
Algorithm Hash digest
SHA256 9127f409506cdc0128040af0f1c7db7fd8aa19a3a1a4d21884b672ae3f0b31ae
MD5 b5e5173aca86999f1ac8a62546409373
BLAKE2b-256 474717eb5110c8e5fdd97e79aaa0254c6b1f19b34a1563a4d504be444e26c6fd

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