Emulator for Google Cloud Functions to run in local
Project description
This module tries to emulate the environment in Google Cloud Functions for Python. It serves the given function on the given module.
For example. lets imagine we have the following cloud function
# mycloudfunction.py
def api(request):
return 'important data'
To emulate we have to call it like so
$ python -m gcp-functions-emulator.http mycloudfunction.py api
And to access the data we can use for example curl
$ curl localhost:5000/api
important data
If you run the server from a terminal, you have to disable the debug. It is disabled by default thoug. Flask looks for file changes, but in interactive terminal there's no file.
from serve import http
port = 5000
module_path = 'mycloudfunction.py'
function_name = 'api'
debug = False
http(module_path, function_name, port, debug)
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
Close
Hashes for gcp-functions-emulator-0.0.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1bce26ab7df1b4a2b18054e741a3e69ad2cbba16a3316bb43a519846216da424 |
|
MD5 | cfa95d543d5de359aef1c030cc7abf90 |
|
BLAKE2b-256 | d4066801ee22ea31f963ea97c3ed7fe6a5c739c3aca2db9fd43605109eb102d6 |
Close
Hashes for gcp_functions_emulator-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b1e5cb310ffa453f6f5518b8b6e30b97d88b948d09ca82d1400d825e6f66e81 |
|
MD5 | c89c87133a084b644ad74b6c22962dcb |
|
BLAKE2b-256 | 8c7107a3fb2c904f09f4e375d5335bdb0f9c9dc63fe56af29b06b28afabed1d5 |