server-sent events python client library based on requests
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bcb7cf905074b18ff9f7322716234c1188dfde805bba38300b37c6b5ae3a20a
|
|
| MD5 |
4e92c9bcb2ebdbbef8dca6286635804f
|
|
| BLAKE2b-256 |
cf73dd6b0ae667c7720ddd5479f6216b1442610fdd162e27ce7bfb8357083f06
|
Provenance
The following attestation bundles were made for requests_sse-0.5.2.tar.gz:
Publisher:
test-deploy.yml on overcat/requests-sse
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
requests_sse-0.5.2.tar.gz -
Subject digest:
2bcb7cf905074b18ff9f7322716234c1188dfde805bba38300b37c6b5ae3a20a - Sigstore transparency entry: 240823735
- Sigstore integration time:
-
Permalink:
overcat/requests-sse@b5e7bb200eceba24a2052ef7c1acc03fbbee49b7 -
Branch / Tag:
refs/tags/0.5.2 - Owner: https://github.com/overcat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
test-deploy.yml@b5e7bb200eceba24a2052ef7c1acc03fbbee49b7 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebd9da245c2bb02bc070617e16b37a260a7386abf6cd9b2a250a6529a92c74cf
|
|
| MD5 |
bf4afd69963078523a8231349966c0dd
|
|
| BLAKE2b-256 |
1573bf4771da460b528edc0ff9f2845682b50d60ffb84b4587f90ef665408195
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
requests_sse-0.5.2-py3-none-any.whl -
Subject digest:
ebd9da245c2bb02bc070617e16b37a260a7386abf6cd9b2a250a6529a92c74cf - Sigstore transparency entry: 240823745
- Sigstore integration time:
-
Permalink:
overcat/requests-sse@b5e7bb200eceba24a2052ef7c1acc03fbbee49b7 -
Branch / Tag:
refs/tags/0.5.2 - Owner: https://github.com/overcat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
test-deploy.yml@b5e7bb200eceba24a2052ef7c1acc03fbbee49b7 -
Trigger Event:
release
-
Statement type: