Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gcp-functions-emulator-0.0.3.tar.gz (2.0 kB view hashes)

Uploaded Source

Built Distribution

gcp_functions_emulator-0.0.3-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page