https://github.com/ebraminio/aiosseclient
Asynchronous Server Side Events (SSE) client for Python 3
https://github.com/ebraminio/aiosseclient
Last synced: about 1 month ago
JSON representation
Asynchronous Server Side Events (SSE) client for Python 3
- Host: GitHub
- URL: https://github.com/ebraminio/aiosseclient
- Owner: ebraminio
- License: mit
- Created: 2017-07-27T22:23:45.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2025-03-12T20:03:49.000Z (2 months ago)
- Last Synced: 2025-04-02T05:08:55.626Z (about 2 months ago)
- Language: Python
- Homepage:
- Size: 54.7 KB
- Stars: 25
- Watchers: 3
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Asynchronous Server Side Events (SSE) Client
========================Similar to [sseclient](https://github.com/btubbs/sseclient) and [sseclient-py](https://github.com/mpetazzoni/sseclient), a tiny package for supporting Server Side Events (SSE) with py3.9 [asyncio](https://www.python.org/dev/peps/pep-3156/) and [aiohttp](http://aiohttp.readthedocs.io/en/stable/).
Install it with this: `pip3 install aiosseclient`
https://pypi.org/project/aiosseclient/
Sample code ([read more](https://wikitech.wikimedia.org/wiki/EventStreams)):
```python
import asyncio
import aiohttp
from aiosseclient import aiosseclientasync def main():
async for event in aiosseclient('https://stream.wikimedia.org/v2/stream/recentchange'):
print(event)loop = asyncio.get_event_loop()
loop.run_until_complete(main())
```Alternative libraries
---------------------
There are different libraries, apparently inspired from this library initially, that right now are
handling session close better using a different API,* https://github.com/rtfol/aiohttp-sse-client
* https://github.com/JelleZijlstra/aiohttp-sse-client2