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") 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.6.0b0.tar.gz (9.8 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.6.0b0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file requests_sse-0.6.0b0.tar.gz.

File metadata

  • Download URL: requests_sse-0.6.0b0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for requests_sse-0.6.0b0.tar.gz
Algorithm Hash digest
SHA256 142795710301286f5acd0cea02bdd7825285fb427179c4b6fce332b8c14dcb9f
MD5 c28d991aae7ca262992ab03f1b0ff3a7
BLAKE2b-256 9024e01888f90ee9e05f031a8d8a3d4c457d49bb36cce745b42fd7a04fca2f32

See more details on using hashes here.

Provenance

The following attestation bundles were made for requests_sse-0.6.0b0.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.6.0b0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for requests_sse-0.6.0b0-py3-none-any.whl
Algorithm Hash digest
SHA256 e862bcf809fefd34cd568898fb9c09609e2d84dd59056103cd96326b0093d2a5
MD5 1ef3f86c7575f49ac69fbb0deabef7c3
BLAKE2b-256 5d27591fad4d9009a12cefe1a5cd46af677d5771575d5efe7cdc74047d83ab08

See more details on using hashes here.

Provenance

The following attestation bundles were made for requests_sse-0.6.0b0-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