Skip to content

googleapis/google-cloudevents-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

bb698e3 Β· Mar 24, 2023
Mar 16, 2023
Mar 16, 2023
Feb 7, 2023
Mar 24, 2023
Mar 23, 2023
Mar 16, 2023
Feb 2, 2023
Jan 14, 2022
Oct 7, 2021
Feb 8, 2023
Mar 24, 2023
Sep 23, 2020
Jun 12, 2020
Feb 26, 2021
Feb 7, 2023
May 12, 2021
Feb 8, 2023
Feb 8, 2023
Sep 22, 2022
Mar 24, 2023
Feb 22, 2023

Repository files navigation

Google CloudEvents - Python

PyPI version

This library provides classes of common event types used with Google services, as defined in the Google Cloudevents repository.

Installation and Usage

Note: This library requires Python 3.7+.

To install this package, run

pip install --upgrade google-events

To use an event class, see the snippet below:

from google.events.cloud import storage

# Parses a json string containing an event payload
# The json payload may be from an HTTP request received by a Cloud Run
# service with event triggers.

def handle_event_trigger(json_payload):
    event = storage.StorageObjectData.from_json(json_payload)
    print(f"{event.bucket}/{event.name} had event")
    return "OK"