Some utilties to work with Google Firestore API.
Project description
Some utilties to work with Google Firestore API.
First utility is firegorest.tidy_doc, to make a neat data dictionary from the event passed by Google Cloud runtime to your cloud function.
Install
pip install firegorest
Example
from logbook import Logger
from firegorest import tidy_doc
from firegorest.types import GCFContext
logger = Logger(__name__)
def act_on_customer_change(event: dict, context: GCFContext):
try:
logger.info('Old Value: {}', tidy_doc(event['oldValue']['fields']))
except KeyError:
pass
try:
logger.info('New Value: {}', tidy_doc(event['value']['fields']))
except KeyError:
pass
resource = context.resource
logger.debug('Resource: {}', resource)
return True
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
firegorest-0.1.0.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for firegorest-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 125c205d0af7d67be28ed22ce058170ba7c805a1c44b8df5cd4d3bdc184ded3a |
|
MD5 | 416c09765cdcb21be589f38d7bc4465c |
|
BLAKE2b-256 | 2c0e3586e06a7c8e05802a35afd5776b5d1b8db017d6a01c72c71947420d7e7f |