Various helper functions for Google Cloud services
Project description
Overview
gcp-ng-helpers is a Python library that provides helper functions for interacting with Google Cloud Platform (GCP) services.
Installation
Use the package manager pip to install gcp-ng-helpers
pip install gcp-ng-helpers
Functions submodule
Http Router
Cloud function by default only serves single '/' (root) http endpoint. With this Http Router you can easy serve much more, without need to parse Request object for method and path
Usage
Define a function with flask.Request argument returning the flaks.Response object Import HttpRouter from functions submodule and register defined function as route with path and method Then inside cloud function entry point function return router.response
from flask import Request, Response, make_response
from gcp_helpers.functions.routers import HttpRouter
def hello_route(request: Request) -> Response:
return make_response('Hello', 200)
router = HttpRouter()
router.register(hello_route, '/hello', 'GET')
def main(request):
return router.response(request)
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 gcp_ng_helpers-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c605467fbc43884b445b091ae29e2355ffe8345acd7bd1f0243b66a41c456b6a |
|
MD5 | ab772b9f56238e2be51328a77e95828a |
|
BLAKE2b-256 | 97688a544469628293a3c3147babde4af4ae6f5551c474be40023e3e7993b87a |