skillfed

sse-starlette

SSE plugin for Starlette

sse-starlette Permissive license BSD-3-Clause Active 846 v3.4.8 released

Install

sse-starlette on PyPI

pip

pip install sse-starlette

uv

uv add sse-starlette

poetry

poetry add sse-starlette

Package facts

License BSD-3-Clause (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 2 — starlette, anyio
Maintenance actively maintained — 8 days since the last release
Last repo commit
First released
Popularity one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13)
Known vulnerabilities none known (OSV.dev, checked 2026-08-13)

Evidence: sse_starlette-3.4.8-py3-none-any.whl

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Internet :: WWW/HTTP

About sse-starlette

from the package's own PyPI description — quoted content, verbatim

Server-Sent Events for Starlette and FastAPI

Downloads (image) [![PyPI Version][pypi-image]][pypi-url] [![Build Status][build-image]][build-url]

> Background: https://sysid.github.io/server-sent-events/

Production ready Server-Sent Events implementation for Starlette and FastAPI following the W3C SSE specification.

Installation

pip install sse-starlette
uv add sse-starlette

# To run the examples (fastapi, uvicorn, pydantic)
uv add sse-starlette[examples]

# Example 03 also needs the DB extras (sqlalchemy, aiosqlite)
uv add sse-starlette[examples,examples-db]

# Recommended ASGI server
uv add sse-starlette[uvicorn,granian,daphne]

Quick Start

```python import asyncio from starlette.applications import Starlette from starlette.routing import Route from sse_starlette import EventSourceResponse

async def generate_events(): for i in range(10): yield {"data": f"Event {i}"} await asyncio.sleep(1)

async def...

Read as markdown · JSON record · Source repository · Homepage

AI interpretation — verify before relying

AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page

Provides Server-Sent Events (SSE) streaming for Starlette and FastAPI applications, following the W3C SSE specification with async/await support, automatic client disconnect detection, and graceful shutdown handling.

Installation is straightforward with low friction—the package is pure Python, wheels are available, and it depends only on starlette and anyio. Active maintenance (last release 8 days ago, 846 GitHub stars) and support for Python 3.10–3.13 indicate solid upkeep.

BSD-3-Clause is permissive and imposes minimal restrictions; you may use, modify, and distribute sse-starlette freely in commercial and proprietary projects provided you include the license notice.

Usage

pip install sse-starlette

from starlette.applications import Starlette
from starlette.routing import Route
from sse_starlette import EventSourceResponse
import asyncio

async def generate_events():
    for i in range(10):
        yield {"data": f"Event {i}"}
        await asyncio.sleep(1)

async def sse_endpoint(request):
    return EventSourceResponse(generate_events())

app = Starlette(routes=[Route("/events", sse_endpoint)])

Requires Python 3.10 or later; Starlette and an ASGI server (e.g., uvicorn) must be installed to run the application.

Verdict: sse-starlette is a production-ready, actively maintained SSE implementation for Starlette and FastAPI with no known vulnerabilities. Low install friction, permissive licensing, and comprehensive async features (graceful shutdown, multi-threaded support, memory channels) make it a solid choice for real-time streaming in modern Python web applications.

Needs verification

  • Whether the package's multi-threaded and multi-loop support is tested in production environments at scale.
  • Performance characteristics and memory overhead when streaming to large numbers of concurrent clients.
server-sent events starlettesse streaming fastapireal-time push notifications pythonasync event streaming asgiw3c sse implementationstarlette eventstream responselong-polling alternative async

Similar packages