--- id: requests-sse version: "0.5.3" license: Apache-2.0 license_treatment: permissive maintenance: active --- # requests-sse — server-sent events python client library based on requests License: permissive · Maintenance: active · Downloads: 217.6K/mo ## 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 above — 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 pip install requests-sse uv add requests-sse poetry add requests-sse ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 217.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags server-sent events client, sse streaming python, http event stream consumer, requests-based sse, real-time event streaming, server sent events library, streaming, http-client, real-time [View on SkillFed](https://skillfed.io/packages/requests-sse) · [View on PyPI](https://pypi.org/project/requests-sse/)