httpx-sse
Consume Server-Sent Event (SSE) messages with HTTPX.
Decision gist · record as of 2026-08-14
Yes, if you need to consume Server-Sent Events from HTTP endpoints in Python. The package has low install friction, no runtime dependencies beyond HTTPX, and is in active use (top 1000 PyPI by downloads). The MIT license is permissive. The beta status and 308-day gap since last release warrant pinning to 0.4.* as the maintainer recommends, but the code is stable for the core use case. Install it if you're already using HTTPX and need SSE support.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires HTTPX to be installed separately; httpx-sse provides only the SSE consumption layer on top of it.
- Low friction install with no runtime dependencies.
- Marked as beta software; maintainer recommends pinning to the 0.4.* series.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
last release 2025-10-10 (308 days) · last repo commit 2025-12-13 · 212 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 238,443,164 downloads/mo, #166 on PyPI
Alternatives
Verify before relying
import httpx
from httpx_sse import connect_sse
with httpx.Client() as client:
with connect_sse(client, "GET", "http://localhost:8000/sse") as event_source:
for sse in event_source.iter_sse():
print(sse.event, sse.data, sse.id, sse.retry)- Whether the package handles automatic reconnection or if manual retry logic is always required.
- Performance characteristics under high-frequency event streams or large payload sizes.
What it is and what it does
httpx-sse is a lightweight wrapper around HTTPX that adds Server-Sent Event (SSE) consumption capabilities. It provides `connect_sse()` and `aconnect_sse()` helpers that return an `EventSource` object with `.iter_sse()` and `.aiter_sse()` methods to iterate over incoming server-sent events. The package handles SSE protocol parsing, including event type, data payload, event ID, and retry timing fields.
The library is designed for consuming real-time event streams from HTTP endpoints that follow the SSE specification. It works with both synchronous HTTPX clients and async clients, and includes utilities for extracting JSON-encoded event data. Reconnection logic is not built-in by design, allowing you to implement retry strategies suited to your use case using the event ID and retry fields exposed by the library.
Use it for
- Consume real-time updates from a web API that streams events (e.g., live notifications, status changes).
- Build async Python applications that listen to SSE endpoints and react to incoming events.
- Test SSE endpoints directly in Python by calling into ASGI/WSGI web apps with HTTPX.
- Parse and handle structured event data (event type, ID, retry timing) from server-sent event streams.
- Implement custom reconnection and retry logic on top of SSE consumption for fault-tolerant streaming.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to consume Server-Sent Events from HTTP endpoints in Python.
The package has low install friction, no runtime dependencies beyond HTTPX, and is in active use (top 1000 PyPI by downloads). The MIT license is permissive. The beta status and 308-day gap since last release warrant pinning to 0.4.* as the maintainer recommends, but the code is stable for the core use case. Install it if you're already using HTTPX and need SSE support.
Install
httpx-sse on PyPI
Before you install
Low friction install with no runtime dependencies. Marked as beta software; maintainer recommends pinning to the 0.4.* series. Last release was 308 days ago; repository is active but aging.
Requires HTTPX to be installed separately; httpx-sse provides only the SSE consumption layer on top of it.
License in practice
MIT license is permissive; you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
import httpx
from httpx_sse import connect_sse
with httpx.Client() as client:
with connect_sse(client, "GET", "http://localhost:8000/sse") as event_source:
for sse in event_source.iter_sse():
print(sse.event, sse.data, sse.id, sse.retry)
Verify before relying
- Whether the package handles automatic reconnection or if manual retry logic is always required.
- Performance characteristics under high-frequency event streams or large payload sizes.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Aging 308 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 238,443,164 / month, #166 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersProgramming 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.9 |
Evidence: httpx_sse-0.4.3-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “httpx SSE streaming”
- httpx-sseConsume Server-Sent Event (SSE) messages from HTTP endpoints using…
- omnigent-clientA typed Python client SDK for driving omnigent sessions over HTTP +…
- writer-sdkPython client library for the Writer REST API, supporting synchronous…
Give your agent the search over MCP, or paste the wish link into any chat.
More WWW/HTTP packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
h11 is a pure-Python HTTP/1.1 protocol implementation that handles parsing and serializing HTTP messages without any built-in I/O, letting you integrate it with any network layer you choose.
HTTPX is a fully featured HTTP client library for Python that provides both sync and async APIs, with support for HTTP/1.1 and HTTP/2, plus an integrated command-line client.
Install it if you are building new projects or modernizing existing ones that rely on HTTP.
A minimal low-level HTTP client library that sends HTTP requests with thread-safe and task-safe connection pooling, supporting HTTP/1.1, HTTP/2, proxies, and both sync and async interfaces.
aiohttp is an async HTTP client and server framework built on asyncio, supporting both WebSockets and middleware-based routing for building concurrent web applications.
Install it if you need async HTTP client or server capabilities in asyncio-based applications.
See also django-eventstream · requests-sse · launchdarkly-eventsource · aiohttp-sse · sse-starlette · aiohttp-sse-client2 · aiohttp-sse-client · sseclient · sseclient-py · filigran-sseclient