Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tokeshu/requests-eventsource
Requests + EventSource = <3
https://github.com/tokeshu/requests-eventsource
Last synced: about 2 months ago
JSON representation
Requests + EventSource = <3
- Host: GitHub
- URL: https://github.com/tokeshu/requests-eventsource
- Owner: tOkeshu
- License: apache-2.0
- Created: 2013-03-01T19:16:07.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-05-22T11:01:26.000Z (over 11 years ago)
- Last Synced: 2024-04-14T14:48:05.253Z (8 months ago)
- Language: Python
- Size: 137 KB
- Stars: 3
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.txt
Awesome Lists containing this project
README
Requests EventSource
=====================requests-eventsource is an EventSource_ implementation on top of
Requests_ and eventsource-parser_... _EventSource: http://www.w3.org/TR/eventsource/
.. _Requests: http://docs.python-requests.org/
.. _eventsource-parser: https://github.com/tOkeshu/eventsource-parserExample
-------::
import requests
from requests_eventsource import eventsourcer = requests.get('http://example.com/ev', stream=True)
for event in eventsource(r):
if event.type == 'rpc':
do_something(event)
if event.type == 'json':
print(json.loads(event.data))License
-------Licensed under the Apache License, Version 2.0.