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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

requests_sse-0.5.2-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for requests_sse-0.5.2.tar.gz
Algorithm Hash digest
SHA256 2bcb7cf905074b18ff9f7322716234c1188dfde805bba38300b37c6b5ae3a20a
MD5 4e92c9bcb2ebdbbef8dca6286635804f
BLAKE2b-256 cf73dd6b0ae667c7720ddd5479f6216b1442610fdd162e27ce7bfb8357083f06

See more details on using hashes here.

Provenance

The following attestation bundles were made for requests_sse-0.5.2.tar.gz:

Publisher: test-deploy.yml on overcat/requests-sse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: requests_sse-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for requests_sse-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ebd9da245c2bb02bc070617e16b37a260a7386abf6cd9b2a250a6529a92c74cf
MD5 bf4afd69963078523a8231349966c0dd
BLAKE2b-256 1573bf4771da460b528edc0ff9f2845682b50d60ffb84b4587f90ef665408195

See more details on using hashes here.

Provenance

The following attestation bundles were made for requests_sse-0.5.2-py3-none-any.whl:

Publisher: test-deploy.yml on overcat/requests-sse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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