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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for gcloud-storage-emulator-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d981238ea4506fd5e8ffcf10a40125063458b61594437da140aff6b628e88f32 |
|
MD5 | a5c12387754cb48cf0b22d88dc55ddf0 |
|
BLAKE2b-256 | 18a56f1a0a08e10ceaad2ce19720194fe7acdc9c4b13802cd8ed93bc82e439c5 |
Hashes for gcloud_storage_emulator-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ecbc0f785ce0badb6eaf6bd4c605d2d3f654333908f3ecc0634f9a872bc7b1d |
|
MD5 | 1d160575c8d6207f2469669a9d841e54 |
|
BLAKE2b-256 | 478daf8ecf482cc17208be2acd471b80d5fdab12d1b2f7383b967563418b9160 |