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.3.tar.gz (9.1 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.3-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: requests_sse-0.5.3.tar.gz
  • Upload date:
  • Size: 9.1 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.5.3.tar.gz
Algorithm Hash digest
SHA256 107c63afb2a2292b422ab2504849f3adb54b4c884700646ebe9f6e4178ba375c
MD5 fca5a600118c087c003fe2e4aa0606fa
BLAKE2b-256 1394f0f29584c3ca24c29a72e19a28136f73ed08adddc93fb8a0c998577c9085

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: requests_sse-0.5.3-py3-none-any.whl
  • Upload date:
  • Size: 10.2 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.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 dc3e053e22fdcf002ca1fbd1794967d42b82b24539f5b7fe0e807301dd4ef4ec
MD5 57f17b51ca6b13d6112c03d2937e0cb2
BLAKE2b-256 5a873704da8cc1cb91cc0ccee8fb03d8ed11217afcd028352f3b1242fee2f4f1

See more details on using hashes here.

Provenance

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