Skip to main content

server-sent events python client library based on requests

Project description

GitHub Workflow Status PyPI Python - Version

A Server-Sent Events python client based on requests, provides a simple interface to process Server-Sent Event.

Installation

pip install requests-sse

Usage

from requests_sse import EventSource

with EventSource("https://stream.wikimedia.org/v2/stream/recentchange") as event_source:
    try:
        for event in event_source:
            print(event)
    except ConnectionError:
        pass

Credits

This project was inspired by aiohttp-sse-client, aiosseclient, sseclient, and sseclient-py.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

requests_sse-0.2.0.tar.gz (8.8 kB view hashes)

Uploaded Source

Built Distribution

requests_sse-0.2.0-py3-none-any.whl (9.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page