Metadata-Version: 2.1
Name: google-events
Version: 0.5.0
Summary: Google Cloudevents library
Home-page: https://github.com/googleapis/google-cloudevents-python/
Author: Google LLC
Author-email: googleapis-packages@google.com
License: Apache License 2.0
Platform: Posix
Platform: MacOS X
Platform: Windows
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE

# Google CloudEvents - Python

[![PyPI version](https://badge.fury.io/py/google-events.svg)](https://badge.fury.io/py/google-events)

This library provides classes of common event types used with Google services,
as defined in the [Google Cloudevents repository](https://github.com/googleapis/google-cloudevents).

## Installation and Usage

**Note**: This library requires Python 3.7+.

To install this package, run

``` sh
pip install --upgrade google-events
```

To use an event class, see the snippet below:

``` python
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"
```
