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
Release files for firegorest 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| firegorest-0.1.0.tar.gz | 3.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| firegorest-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.8 kB
Release files / firegorest-0.1.0.tar.gz
| Download URL | firegorest-0.1.0.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5eb626184d75cf6436c2636783a3da5ae2f50935e9f218968f098c8b16846aef
|
|
BLAKE2b-256 checksum How to use checksums |
75e3f3210df0a8884da8fcb938f692400ed27225ba120a77b9dea5d83e5c38f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.0 CPython/3.7.5 Linux/5.3.0-26-generic
|
Release files / firegorest-0.1.0-py3-none-any.whl
| Download URL | firegorest-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
125c205d0af7d67be28ed22ce058170ba7c805a1c44b8df5cd4d3bdc184ded3a
|
|
BLAKE2b-256 checksum How to use checksums |
2c0e3586e06a7c8e05802a35afd5776b5d1b8db017d6a01c72c71947420d7e7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.0 CPython/3.7.5 Linux/5.3.0-26-generic
|