Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

requests-sse

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

requests-sse

server-sent events python client library based on requests

  • 0.3.2
  • PyPI
  • Socket score

Maintainers
1

============ 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>.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc