Skip to main content

Google Cloudevents library

Project description

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"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

google-events-0.5.0.tar.gz (127.2 kB view hashes)

Uploaded Source

Built Distribution

google_events-0.5.0-py3-none-any.whl (246.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page