============
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": "<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/ca/4a/b63dc284e6cde3959c55343336d3aca36f800c06ca1024281c798d7f637e/requests_sse-0.5.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.5.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": "932f5e54911f42bd2d97147d6f8f7dfb880c367d1f31c56210fec36540a75a3a",
"md5": "6368983ec44ade38e37cc1cf06ec7275",
"sha256": "549c21737f64ceb01859d08fe286e213a128748395ae5badbe2d734b25dbc5e0"
},
"downloads": -1,
"filename": "requests_sse-0.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6368983ec44ade38e37cc1cf06ec7275",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.7",
"size": 9853,
"upload_time": "2025-01-09T02:55:09",
"upload_time_iso_8601": "2025-01-09T02:55:09.832875Z",
"url": "https://files.pythonhosted.org/packages/93/2f/5e54911f42bd2d97147d6f8f7dfb880c367d1f31c56210fec36540a75a3a/requests_sse-0.5.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ca4ab63dc284e6cde3959c55343336d3aca36f800c06ca1024281c798d7f637e",
"md5": "232dfc8f77229365cacdce2cd9da46c2",
"sha256": "9b22282b44ce340a5243f9ec82f62daa573d57f8f9f08acf8e4c7cd9bac701a2"
},
"downloads": -1,
"filename": "requests_sse-0.5.0.tar.gz",
"has_sig": false,
"md5_digest": "232dfc8f77229365cacdce2cd9da46c2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.7",
"size": 8930,
"upload_time": "2025-01-09T02:55:11",
"upload_time_iso_8601": "2025-01-09T02:55:11.411741Z",
"url": "https://files.pythonhosted.org/packages/ca/4a/b63dc284e6cde3959c55343336d3aca36f800c06ca1024281c798d7f637e/requests_sse-0.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-09 02:55:11",
"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"
}