cloudevents
CloudEvents Python SDK
What it is and what it does
CloudEvents is a Python SDK for the CNCF CloudEvents specification, enabling you to construct and exchange events in a standardized format across distributed systems. It handles both binary and structured HTTP content modes, allowing events to be sent as HTTP headers plus body or as JSON payloads. The package manages CloudEvent attributes (type, source, id, specversion) and arbitrary event data, with automatic id generation and v1.0 as the default specification version.
The SDK is designed for serverless and event-driven architectures where multiple systems need to exchange events reliably. It works with popular HTTP libraries like requests and web frameworks like Flask, making it straightforward to integrate into existing Python applications. With low install friction (only two dependencies) and support for Python 3.10 through 3.14, it fits into modern Python environments.
Use it for:
- Sending events from a producer service to an event broker or HTTP endpoint using binary or structured CloudEvent format.
- Receiving and parsing CloudEvents in a Flask or other WSGI-based web application endpoint.
- Building serverless event handlers that need to conform to the CloudEvents specification for interoperability.
- Converting between CloudEvents versions (v1.0 and v0.3) when integrating legacy and modern event systems.
- Standardizing event metadata (type, source, id) across microservices in an event-driven architecture.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Python primitives to create, serialize, and deserialize CloudEvents v1.0 and v0.3 in binary and structured HTTP formats for event-driven architectures.
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and is widely used (top 5000 on PyPI). It directly implements a CNCF standard, making it the natural choice for Python projects that need CloudEvents support. The permissive Apache license and broad Python version support (3.10–3.14) add to its appeal.
Install
cloudevents on PyPI
pip
pip install cloudeventsuv
uv add cloudeventspoetry
poetry add cloudeventsInstalling cloudevents
Before you install
Low friction install with just two runtime dependencies (deprecation and python-dateutil). Actively maintained with a recent release 64 days ago and an active repository.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install cloudevents
from cloudevents.core.v1.event import CloudEvent
from cloudevents.core.bindings.http import to_binary_event
attributes = {"type": "com.example.type", "source": "https://example.com"}
event = CloudEvent(attributes, {"message": "Hello"})
message = to_binary_event(event)
Requires Python 3.10 or later.
Verify before relying
- Whether the SDK's 'work in progress' status (noted in description) affects production readiness despite Production/Stable classifier.
- Support timeline for CloudEvents versions beyond v1.0 and v0.3.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — deprecation, python-dateutil |
| Maintenance | actively maintained — 64 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 11,244,857/month — #1,405 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cloudevents-2.2.0-py3-none-any.whl
Keywords: CloudEvents, Eventing, Serverless
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
fastapi-cloudeventsFastAPI plugin that automatically parses and…
permissive · top 15,000 on PyPI
functions-frameworkA lightweight FaaS framework that lets you…
permissive · top 5,000 on PyPI
google-eventsProvides Python classes for Google CloudEvents…
permissive · top 15,000 on PyPI
slackeventsapiReceives and parses events from Slack's Events…
permissive · top 15,000 on PyPI
eventletEventlet provides concurrent network…
permissive · top 5,000 on PyPI
modalModal is a Python client library that lets you…
permissive · top 1,000 on PyPI
dagster-cloudDagster Cloud is a managed orchestration…
permissive · top 5,000 on PyPI
yamlableConverts Python objects to YAML and back using…
permissive · top 15,000 on PyPI
aeventkitaeventkit provides event-driven data pipelines…
permissive · top 15,000 on PyPI
qstashPython SDK for publishing and receiving…
permissive · top 15,000 on PyPI