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 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.

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.3.2.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

requests_sse-0.3.2-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file requests_sse-0.3.2.tar.gz.

File metadata

  • Download URL: requests_sse-0.3.2.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for requests_sse-0.3.2.tar.gz
Algorithm Hash digest
SHA256 3e17bd324e500c9b11c7c23dd00af3f0222070328134bda67a8917985cfc4127
MD5 47219073c1ef87736ed1258e0b24357d
BLAKE2b-256 2f3817d72af6819a3443c1d42a7d02adce430b11e39b03f8273d684385eaa53d

See more details on using hashes here.

File details

Details for the file requests_sse-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for requests_sse-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c3399b689f6e7bf0eac7c2031211d66ffbb3ab77afc6c9226a71c73c06609f61
MD5 2eb104dce524f320c3b65ee67a562ff3
BLAKE2b-256 1eba02926da93761774b633f9b39363782712fe33d6db37e7dda7f63698be70b

See more details on using hashes here.

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