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
```python
# 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.
```python
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.2.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

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

gcp_functions_emulator-0.0.2-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file gcp-functions-emulator-0.0.2.tar.gz.

File metadata

  • Download URL: gcp-functions-emulator-0.0.2.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for gcp-functions-emulator-0.0.2.tar.gz
Algorithm Hash digest
SHA256 ee3d8e6b2d7171d5075a43b9d4799e1b5c2946e4415f7b1696c0c3646e170d9a
MD5 d06a9fc45851f7fb03cd95df963badc3
BLAKE2b-256 7f54e45d14aeab65e9be58140731b5cb95d9b2991986d77ace4e1623410d82df

See more details on using hashes here.

File details

Details for the file gcp_functions_emulator-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: gcp_functions_emulator-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for gcp_functions_emulator-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 663ade54c63ec96af72020a07715004070dadb1e28387fa47feaadb98b42b86a
MD5 add87be45fd3de6cb18972ab8fba1b20
BLAKE2b-256 aa1159c906ad60fb775ec1bbbd0cb806348bc603b075bcda8a29ab741715da17

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