Skip to main content

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

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 details)

Uploaded Source

Built Distribution

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

firegorest-0.1.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file firegorest-0.1.0.tar.gz.

File metadata

  • Download URL: firegorest-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/3.7.5 Linux/5.3.0-26-generic

File hashes

Hashes for firegorest-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5eb626184d75cf6436c2636783a3da5ae2f50935e9f218968f098c8b16846aef
MD5 3d03fc2ba6c3e31673c351bf819fdc99
BLAKE2b-256 75e3f3210df0a8884da8fcb938f692400ed27225ba120a77b9dea5d83e5c38f0

See more details on using hashes here.

File details

Details for the file firegorest-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: firegorest-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/3.7.5 Linux/5.3.0-26-generic

File hashes

Hashes for firegorest-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 125c205d0af7d67be28ed22ce058170ba7c805a1c44b8df5cd4d3bdc184ded3a
MD5 416c09765cdcb21be589f38d7bc4465c
BLAKE2b-256 2c0e3586e06a7c8e05802a35afd5776b5d1b8db017d6a01c72c71947420d7e7f

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page