A stub emulator for the Google Cloud Storage API
Maintained. Last release 4 months ago, commits in 2 of the last 26 weeks. Weaker on commit activity and release cadence.
pip install gcp-storage-emulatorLocal 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 THE API
Installation
pip install gcp-storage-emulator
CLI Usage
Starting the emulator
Start the emulator with:
gcp-storage-emulator start
By default, the server will listen on http://localhost:9023 and data is stored under ./.cloudstorage. You can configure the folder using the env variables STORAGE_BASE (default ./) and STORAGE_DIR (default .cloudstorage).
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 --in-memory parameter. For tests, you might want to consider starting up the server from your code (see the Python APIs)
If you're using the Google client library (e.g. google-cloud-storage for Python) then you can set the STORAGE_EMULATOR_HOST environment variable to tell the library to connect to your emulator endpoint rather than the standard https://storage.googleapis.com, e.g.:
export STORAGE_EMULATOR_HOST=http://localhost:9023
Wiping data
You can wipe the data by running
gcp-storage-emulator wipe