requests-sse 0.3.2

Creator: bradpython12

Last updated:

0 purchases

requests-sse 0.3.2 Image
requests-sse 0.3.2 Images

Languages

Categories

Add to Cart

Description:

requestssse 0.3.2

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

Installation
pip install requests-sse


Usage
import requests
from requests_sse import EventSource, InvalidStatusCodeError, InvalidContentTypeError

with EventSource("https://stream.wikimedia.org/v2/stream/recentchange", timeout=30) as event_source:
try:
for event in event_source:
print(event)
except InvalidStatusCodeError:
pass
except InvalidContentTypeError:
pass
except requests.RequestException:
pass


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

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.