requests-sse
server-sent events python client library based on requests
What it is and what it does
requests-sse wraps the requests library to consume Server-Sent Events from HTTP endpoints. It provides an EventSource context manager that yields individual events from an SSE stream, with built-in exception types (InvalidStatusCodeError, InvalidContentTypeError) for handling protocol violations. The package is a thin, synchronous client designed for straightforward SSE consumption in Python applications.
Typical usage involves opening an EventSource to a streaming endpoint, iterating over events in a loop, and catching requests or SSE-specific exceptions. It's built on top of requests, so it inherits that library's connection handling, timeout management, and HTTP features. The package supports Python 3.7 and later, including current and recent Python versions.
Use it for:
- Consume real-time updates from public SSE endpoints like Wikimedia event streams or similar live data feeds
- Build monitoring dashboards that pull continuous event streams from backend services
- Integrate live notifications or status updates into Python applications without polling
- Process event-driven data pipelines where events arrive asynchronously from an HTTP source
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a Python client for consuming Server-Sent Events (SSE) streams over HTTP using the requests library, with built-in error handling for invalid status codes and content types.
Yes. Low install friction, active maintenance, permissive license, no known vulnerabilities, and a straightforward API make this a solid choice for SSE consumption in Python. Install it if you need to consume Server-Sent Events and prefer a synchronous, requests-based approach over async alternatives.
Install
requests-sse on PyPI
pip
pip install requests-sseuv
uv add requests-ssepoetry
poetry add requests-sseInstalling requests-sse
Before you install
Low install friction with a single runtime dependency (requests). Active maintenance with recent commits and support across Python 3.7 through 3.14, including PyPy.
License in practice
Licensed under Apache-2.0 (permissive), allowing free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install requests-sse
import requests
from requests_sse import EventSource
with EventSource("https://example.com/stream", timeout=30) as event_source:
for event in event_source:
print(event)
Verify before relying
- Whether the package handles reconnection logic or requires manual retry on connection loss
- Performance characteristics when consuming high-frequency event streams
- Support for custom headers or authentication beyond what requests provides
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<4.0,>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — requests |
| Maintenance | actively maintained — 156 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 217,590/month — #9,355 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: requests_sse-0.5.3-py3-none-any.whl
Keywords: server-sent events, sse, stream, requests
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
aiohttp-sse-clientProvides an async Python client for consuming…
permissive · top 15,000 on PyPI
httpx-sseConsume Server-Sent Event (SSE) messages from…
permissive · top 1,000 on PyPI
sseclient-pyParses Server-Sent Events (SSE) from HTTP…
permissive · top 5,000 on PyPI
launchdarkly-eventsourceConsumes Server-Sent Events (SSE) from remote…
permissive · top 5,000 on PyPI
aiohttp-sse-client2Provides an async Python client for consuming…
permissive · top 15,000 on PyPI
django-eventstreamAdds Server-Sent Events (SSE) streaming to…
permissive · top 15,000 on PyPI
sseclientIterates over Server Sent Event (SSE) streams…
permissive · top 15,000 on PyPI
filigran-sseclientProvides a Python iterator interface for…
permissive · top 5,000 on PyPI
sse-starletteProvides Server-Sent Events streaming for…
permissive · top 1,000 on PyPI
aiohttp-sseProvides server-sent events (EventSource)…
permissive · top 15,000 on PyPI