Registry / web-framework / fastapi-cloudevents

fastapi-cloudevents

JSON →
library2.0.2pypypiunverified

A FastAPI plugin for integrating CloudEvents. Current version 2.0.2, release cadence: sporadic.

web-frameworkhttp-networkingawsgcpazure
Install & Compatibility
Where this runs
tested against v2.0.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.010s · 35.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.2s · import 0.010s · 35MB
33MB installed
● package 33MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

from fastapi_cloudevents import CloudEvent

Basic example of receiving and sending CloudEvents with FastAPI.

from fastapi import FastAPI, Request from fastapi_cloudevents import from_event, to_event from cloudevents.http import CloudEvent app = FastAPI() @app.post("/") async def receive(request: Request): event = from_event(request) print(event) return to_event(CloudEvent({"type": "example", "source": "test"}, {"message": "Hello"}))
Debug
Known footguns
breakingVersion 2.0.0 introduced Pydantic V2 support, dropping V1. If your project uses Pydantic V1, stay on v1.x or migrate models.
deprecatedUse of `from_event` on raw dicts is deprecated; always pass a FastAPI Request object.
gotchaThe `to_event` function returns a Starlette Response, not a CloudEvent object. Do not try to call `.data` on it.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
27 hits · last 30 days
petalbot
7
gptbot
4
ahrefsbot
4
claudebot
3
dotbot
1
script
1
Resources