--- id: aiohttp-sse version: "2.2.0" license: Apache 2 license_treatment: permissive maintenance: active --- # aiohttp-sse — Server-sent events support for aiohttp. License: permissive · Maintenance: active · Downloads: 585.1K/mo ## What it is and what it does aiohttp-sse wraps the EventSource protocol (server-sent events) for use in aiohttp web applications. It provides a context manager that lets you send data to a client over a persistent HTTP connection without closing it, enabling real-time push notifications and live data streams. The package handles the text/event-stream content type and connection lifecycle, so you focus on generating and sending data. The typical workflow is to define an aiohttp route handler, use sse_response to open a streaming connection, then loop sending data while checking is_connected(). The client side uses the browser's native EventSource API to receive messages. It's a thin, focused layer on top of aiohttp for one specific use case: pushing events from server to client. Use it for: - Real-time dashboards or monitoring interfaces that display live server metrics or status updates. - Live notifications or alerts pushed to web clients without polling. - Streaming log output or progress updates from long-running server tasks to a web UI. - Chat or collaboration features where the server broadcasts events to multiple connected clients. - Stock tickers, sports scores, or other live data feeds delivered to web browsers. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides server-sent events (EventSource) support for aiohttp applications, allowing servers to push data to connected clients over HTTP without closing the connection. Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and a permissive license. It solves a specific, well-defined problem (server-sent events in aiohttp) with a clean API. Use it when you need to push data from an aiohttp server to browser clients over HTTP. ## Install pip install aiohttp-sse uv add aiohttp-sse poetry add aiohttp-sse ## Installing aiohttp-sse Before you install: Low friction installation with a single dependency on aiohttp. Actively maintained with recent commits and a stable release history since 2017. Supports current Python versions (3.8–3.12). License in practice: Licensed under Apache 2 (permissive), allowing use in commercial and private projects with minimal restrictions. Quickstart: pip install aiohttp-sse from aiohttp import web from aiohttp_sse import sse_response async def stream_handler(request): async with sse_response(request) as resp: while resp.is_connected(): await resp.send(data) return resp Requires aiohttp 3+ and Python 3.8 or later. Verify before relying: - Whether the package handles reconnection and backpressure automatically or if the caller must manage these. - Performance characteristics under high client counts or message throughput. - Support for custom event types beyond the default 'message' event. ## Package facts - License: Apache 2 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 585.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags server-sent events aiohttp, sse streaming http, aiohttp event stream, real-time push notifications, text/event-stream protocol, async http streaming, eventsource aiohttp, streaming, real-time, async-http [View on SkillFed](https://skillfed.io/packages/aiohttp-sse) · [View on PyPI](https://pypi.org/project/aiohttp-sse/)