# 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"
```
Raw data
{
"_id": null,
"home_page": "https://github.com/googleapis/google-cloudevents-python/",
"name": "google-events",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": null,
"author": "Google LLC",
"author_email": "googleapis-packages@google.com",
"download_url": "https://files.pythonhosted.org/packages/77/37/57993f165349188d7f1dbeab3f5fceb035a74586221dd00f4c93f373df04/google_events-0.13.0.tar.gz",
"platform": "Posix",
"description": "# Google CloudEvents - Python\n\n[![PyPI version](https://badge.fury.io/py/google-events.svg)](https://badge.fury.io/py/google-events)\n\nThis library provides classes of common event types used with Google services,\nas defined in the [Google Cloudevents repository](https://github.com/googleapis/google-cloudevents).\n\n## Installation and Usage\n\n**Note**: This library requires Python 3.7+.\n\nTo install this package, run\n\n``` sh\npip install --upgrade google-events\n```\n\nTo use an event class, see the snippet below:\n\n``` python\nfrom google.events.cloud import storage\n\n# Parses a json string containing an event payload\n# The json payload may be from an HTTP request received by a Cloud Run\n# service with event triggers.\n\ndef handle_event_trigger(json_payload):\n event = storage.StorageObjectData.from_json(json_payload)\n print(f\"{event.bucket}/{event.name} had event\")\n return \"OK\"\n```\n",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "Google Cloudevents library",
"version": "0.13.0",
"project_urls": {
"Homepage": "https://github.com/googleapis/google-cloudevents-python/"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bf3a812ad95928236bfe2f654df9f2f9cf02d5122029a4d04dbfb1dc365b2cb4",
"md5": "4514f2a5cda510a0dd90c472fd8f322f",
"sha256": "a17e9a54aa27b06fdca3defdc81bd3e07e685734e90b6dd9c297f0898004b74c"
},
"downloads": -1,
"filename": "google_events-0.13.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4514f2a5cda510a0dd90c472fd8f322f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 561294,
"upload_time": "2024-09-26T23:37:13",
"upload_time_iso_8601": "2024-09-26T23:37:13.542405Z",
"url": "https://files.pythonhosted.org/packages/bf/3a/812ad95928236bfe2f654df9f2f9cf02d5122029a4d04dbfb1dc365b2cb4/google_events-0.13.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "773757993f165349188d7f1dbeab3f5fceb035a74586221dd00f4c93f373df04",
"md5": "58e6242b03068111817953027b835a52",
"sha256": "bd267e39865f7ca1a120993dc00c65dcb2770ee13ae95a34f76d816957e297d8"
},
"downloads": -1,
"filename": "google_events-0.13.0.tar.gz",
"has_sig": false,
"md5_digest": "58e6242b03068111817953027b835a52",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 359200,
"upload_time": "2024-09-26T23:37:15",
"upload_time_iso_8601": "2024-09-26T23:37:15.228966Z",
"url": "https://files.pythonhosted.org/packages/77/37/57993f165349188d7f1dbeab3f5fceb035a74586221dd00f4c93f373df04/google_events-0.13.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-26 23:37:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "googleapis",
"github_project": "google-cloudevents-python",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "google-events"
}