Skip to main content

A Flask extension for HTML5 server-sent events support, powered by Redis.

Example of sending events:

from flask import Flask
from flask_sse import sse

app = Flask(__name__)
app.config["REDIS_URL"] = "redis://localhost"
app.register_blueprint(sse, url_prefix='/stream')

@app.route('/send')
def send_message():
    sse.publish({"message": "Hello!"}, type='greeting')
    return "Message sent!"

To receive events on a webpage, use Javascript to connect to the event stream, like this:

var source = new EventSource("{{ url_for('sse.stream') }}");
source.addEventListener('greeting', function(event) {
    var data = JSON.parse(event.data);
    // do what you want with this data
}, false);

The full documentation for this project is hosted on ReadTheDocs.

Metadata

Release files for Flask-SSE 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Flask-SSE 1.0.0
File Size Uploaded
Flask-SSE-1.0.0.tar.gz 16.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Flask-SSE 1.0.0
File Interpreter ABI Platform
Flask_SSE-1.0.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 21.1 kB

Release files / Flask-SSE-1.0.0.tar.gz

Download URL Flask-SSE-1.0.0.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4f84714c2549a45e4f17bfc5f68ee8a9f298b22740a6844404d1c74551f2090d
BLAKE2b-256 checksum
How to use checksums
383182586853cb1c0fcc2b8b533891606a779acc0da7d4cda5c8d7f2c2b05a29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.2 CPython/3.8.6

Release files / Flask_SSE-1.0.0-py2.py3-none-any.whl

Download URL Flask_SSE-1.0.0-py2.py3-none-any.whl
Size 5.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
f86d7ecff0607333755c444130c395e7a133fb7ae6cf76fbd29b1da36d34776b
BLAKE2b-256 checksum
How to use checksums
7183f9fe86f554a153fdd300fb8027121d508a2177605bd158d967ddd7325948
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.2 CPython/3.8.6

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.2.1

3 release files

0.2

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page