============
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%3D3.8-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": ">=3.8,<4.0",
"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/19/7c/d3b8264b5a4d829eb9216a64a80e00215d3bc7af436f89ee84c4fd08b766/requests_sse-0.3.0.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%3D3.8-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.0",
"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": "ca4e26e49061ea0e0ea1c126050e2a969d71806d34d50dba9e9ab3cda5ef77e2",
"md5": "88fe518389f1045071921d7d5bef0bd3",
"sha256": "4a81550995e3b26fe2c75796a893a1fea708d43408e445b67ab35ec4ffca6bf2"
},
"downloads": -1,
"filename": "requests_sse-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "88fe518389f1045071921d7d5bef0bd3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 9708,
"upload_time": "2023-11-12T00:30:52",
"upload_time_iso_8601": "2023-11-12T00:30:52.765815Z",
"url": "https://files.pythonhosted.org/packages/ca/4e/26e49061ea0e0ea1c126050e2a969d71806d34d50dba9e9ab3cda5ef77e2/requests_sse-0.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "197cd3b8264b5a4d829eb9216a64a80e00215d3bc7af436f89ee84c4fd08b766",
"md5": "b6c8f47a87ced36aa6d3a2c55f0581f4",
"sha256": "7ce67364739d848a3f0bab4b7165acf05a60a7f508a1a449e09114654bcff5a8"
},
"downloads": -1,
"filename": "requests_sse-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "b6c8f47a87ced36aa6d3a2c55f0581f4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 8968,
"upload_time": "2023-11-12T00:30:56",
"upload_time_iso_8601": "2023-11-12T00:30:56.185330Z",
"url": "https://files.pythonhosted.org/packages/19/7c/d3b8264b5a4d829eb9216a64a80e00215d3bc7af436f89ee84c4fd08b766/requests_sse-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-12 00:30:56",
"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"
}