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 easily 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)
or
from flask import Request, Response, make_response
from gcp_helpers.functions.routers import HttpRouter
router = HttpRouter()
@router.route("/hello", 'GET')
def hello_route(request: Request) -> Response:
return make_response('Hello', 200)
def main(request):
return router.response(request)
Tasks submodule
Manager
CloudTasksManager class is wrapper for cloud task api. Allows to shorten task creation. Currently, supports only http task creation
Firestore
Collection
FirestoreCollection and FirestoreCollectionGroup are wrappers for firestore read/write operations bounded to the defined collection or collection group.
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
File details
Details for the file gcp_ng_helpers-0.0.19.tar.gz
.
File metadata
- Download URL: gcp_ng_helpers-0.0.19.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f3da3ab28840587bfc12c2e2d15e74803c8d293df7f4bbd341b1cbc32aaad5a |
|
MD5 | ec8aa5906e5b8bcefb391900846b9f0c |
|
BLAKE2b-256 | 83e168a52939e864c74ec0c33caa669d230883f9a4e7c7aaf4f6fe2b63deceb6 |
File details
Details for the file gcp_ng_helpers-0.0.19-py3-none-any.whl
.
File metadata
- Download URL: gcp_ng_helpers-0.0.19-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c570d78433fd54b292680558db3604a9b4fbdb9311ee56c488afdb922438da5 |
|
MD5 | 1ab605491c31c2e42453f64672e07343 |
|
BLAKE2b-256 | 5bdbe6c3ca82e3dce55dc7de1fca3be25dc36f946879738dbbf8aa422324899f |