skillfed

cloudevents

CloudEvents Python SDK

cloudevents v2.2.0 11.2M downloads/30d#1,405 on PyPI341
Permissive license Apache-2.0 Active released

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 cloudevents

uv

uv add cloudevents

poetry

poetry add cloudevents

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: System AdministratorsLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Typing :: Typed

Tags

cloudevents python sdkevent serialization httpserverless event formatcloudevents binary structuredevent-driven architecturecncf cloudeventsevent specification implementation
event-drivenserverlesscncf-standard

More WWW/HTTP packages