============
requests-sse
============
.. image:: https://img.shields.io/github/actions/workflow/status/overcat/requests-sse/test-deploy.yml?branch=main
:alt: GitHub Workflow Status
:target: https://github.com/overcat/requests-sse/actions
.. image:: https://img.shields.io/pypi/v/requests-sse.svg
:alt: PyPI
:target: https://pypi.python.org/pypi/requests-sse
.. image:: https://img.shields.io/badge/python-%3E%3D37-blue
:alt: Python - Version
:target: https://pypi.python.org/pypi/stellar-sdk
A Server-Sent Events python client based on requests, provides a simple interface to process `Server-Sent Events <https://www.w3.org/TR/eventsource>`_.
Installation
------------
.. code-block:: bash
pip install requests-sse
Usage
-----
.. code-block:: python
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 <https://github.com/rtfol/aiohttp-sse-client>`_, `aiosseclient <https://github.com/ebraminio/aiosseclient>`_,
`sseclient <https://github.com/btubbs/sseclient>`_, and `sseclient-py <https://github.com/mpetazzoni/sseclient>`_.
Raw data
{
"_id": null,
"home_page": "https://github.com/overcat/requests-sse",
"name": "requests-sse",
"maintainer": "overcat",
"docs_url": null,
"requires_python": "<4.0,>=3.7",
"maintainer_email": "4catcode@gmail.com",
"keywords": "server-sent events, sse, stream, requests",
"author": "overcat",
"author_email": "4catcode@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/2f/38/17d72af6819a3443c1d42a7d02adce430b11e39b03f8273d684385eaa53d/requests_sse-0.3.2.tar.gz",
"platform": null,
"description": "============\nrequests-sse\n============\n\n.. image:: https://img.shields.io/github/actions/workflow/status/overcat/requests-sse/test-deploy.yml?branch=main\n :alt: GitHub Workflow Status\n :target: https://github.com/overcat/requests-sse/actions\n.. image:: https://img.shields.io/pypi/v/requests-sse.svg\n :alt: PyPI\n :target: https://pypi.python.org/pypi/requests-sse\n.. image:: https://img.shields.io/badge/python-%3E%3D37-blue\n :alt: Python - Version\n :target: https://pypi.python.org/pypi/stellar-sdk\n\nA Server-Sent Events python client based on requests, provides a simple interface to process `Server-Sent Events <https://www.w3.org/TR/eventsource>`_.\n\nInstallation\n------------\n.. code-block:: bash\n\n pip install requests-sse\n\nUsage\n-----\n.. code-block:: python\n\n import requests\n from requests_sse import EventSource, InvalidStatusCodeError, InvalidContentTypeError\n\n with EventSource(\"https://stream.wikimedia.org/v2/stream/recentchange\", timeout=30) as event_source:\n try:\n for event in event_source:\n print(event)\n except InvalidStatusCodeError:\n pass\n except InvalidContentTypeError:\n pass\n except requests.RequestException:\n pass\n\nCredits\n-------\n\nThis project was inspired by `aiohttp-sse-client <https://github.com/rtfol/aiohttp-sse-client>`_, `aiosseclient <https://github.com/ebraminio/aiosseclient>`_,\n`sseclient <https://github.com/btubbs/sseclient>`_, and `sseclient-py <https://github.com/mpetazzoni/sseclient>`_.\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "server-sent events python client library based on requests",
"version": "0.3.2",
"project_urls": {
"Bug Tracker": "https://github.com/overcat/requests-sse/issues",
"Documentation": "https://github.com/overcat/requests-sse",
"Homepage": "https://github.com/overcat/requests-sse",
"Repository": "https://github.com/overcat/requests-sse"
},
"split_keywords": [
"server-sent events",
" sse",
" stream",
" requests"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1eba02926da93761774b633f9b39363782712fe33d6db37e7dda7f63698be70b",
"md5": "2eb104dce524f320c3b65ee67a562ff3",
"sha256": "c3399b689f6e7bf0eac7c2031211d66ffbb3ab77afc6c9226a71c73c06609f61"
},
"downloads": -1,
"filename": "requests_sse-0.3.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2eb104dce524f320c3b65ee67a562ff3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.7",
"size": 9718,
"upload_time": "2024-05-06T12:09:29",
"upload_time_iso_8601": "2024-05-06T12:09:29.301861Z",
"url": "https://files.pythonhosted.org/packages/1e/ba/02926da93761774b633f9b39363782712fe33d6db37e7dda7f63698be70b/requests_sse-0.3.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2f3817d72af6819a3443c1d42a7d02adce430b11e39b03f8273d684385eaa53d",
"md5": "47219073c1ef87736ed1258e0b24357d",
"sha256": "3e17bd324e500c9b11c7c23dd00af3f0222070328134bda67a8917985cfc4127"
},
"downloads": -1,
"filename": "requests_sse-0.3.2.tar.gz",
"has_sig": false,
"md5_digest": "47219073c1ef87736ed1258e0b24357d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.7",
"size": 8986,
"upload_time": "2024-05-06T12:09:30",
"upload_time_iso_8601": "2024-05-06T12:09:30.909387Z",
"url": "https://files.pythonhosted.org/packages/2f/38/17d72af6819a3443c1d42a7d02adce430b11e39b03f8273d684385eaa53d/requests_sse-0.3.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-06 12:09:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "overcat",
"github_project": "requests-sse",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "requests-sse"
}