File: README.rst

package info (click to toggle)
aiohttp-sse-client2 0.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 264 kB
  • sloc: python: 652; makefile: 85
file content (61 lines) | stat: -rw-r--r-- 1,872 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
This is a fork of the `aiohttp-sse-client <https://github.com/rtfol/aiohttp-sse-client>`__
project by Jason Hu. The motivations for the fork are:

* Better error messages when the request fails (`#190 <https://github.com/rtfol/aiohttp-sse-client>`__)
* Update the library to support new Python versions

The fork will be retired if the upstream package comes back alive.

Fork changelog
--------------

* 0.3.0 (February 7, 2023)
  * Drop support for Python 3.6
  * Support Python 3.10 and 3.11
  * Include response body in exception for non-200 response codes

Original README follows:

==========
SSE Client
==========

A Server-Sent Event python client base on aiohttp, provides a simple interface to process `Server-Sent Event <https://www.w3.org/TR/eventsource>`_.

* Free software: Apache Software License 2.0
* Documentation: https://aiohttp-sse-client.readthedocs.io.


Features
--------

* Full asyncio support
* Easy to integrate with other aiohttp based project
* Auto-reconnect for network issue
* Support python 3.6 and above

Usage
--------
.. code-block:: python

    from aiohttp_sse_client2 import client as sse_client

    async with sse_client.EventSource(
        'https://stream.wikimedia.org/v2/stream/recentchange'
    ) as event_source:
        try:
            async for event in event_source:
                print(event)
        except ConnectionError:
            pass

Credits
-------

This project was inspired by `aiosseclient <https://github.com/ebraminio/aiosseclient>`_,
`sseclient <https://github.com/btubbs/sseclient>`_, and `sseclient-py <https://github.com/mpetazzoni/sseclient>`_.

This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage