<commit_before>Flask SSE |docs|
================
A Flask extension for HTML5 `server-sent events`_ support, powered by Redis_.

Example of sending events:

.. code-block:: python

    from flask import Flask, json
    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('event-type', {"message": "Hello!"})
        return "Message sent!"

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

.. code-block:: javascript

    var source = new EventSource("{{ url_for('sse.stream') }}");
    source.addEventListener('event-type', 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. <http://flask-sse.readthedocs.org/>`_

.. _server-sent events: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events
.. _Redis: http://www.redis.io/

.. |docs| image:: https://readthedocs.org/projects/flask-sse/badge/?version=latest&style=flat
   :target: http://flask-sse.readthedocs.org/
   :alt: Documentation
<commit_msg>travis and codecov badges<commit_after>Flask SSE |build-status| |coverage-status| |docs|
=================================================
A Flask extension for HTML5 `server-sent events`_ support, powered by Redis_.

Example of sending events:

.. code-block:: python

    from flask import Flask, json
    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('event-type', {"message": "Hello!"})
        return "Message sent!"

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

.. code-block:: javascript

    var source = new EventSource("{{ url_for('sse.stream') }}");
    source.addEventListener('event-type', 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. <http://flask-sse.readthedocs.org/>`_

.. _server-sent events: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events
.. _Redis: http://www.redis.io/

.. |build-status| image:: https://travis-ci.org/singingwolfboy/flask-sse.svg?branch=master&style=flat
   :target: https://travis-ci.org/singingwolfboy/flask-sse
   :alt: Build status
.. |coverage-status| image:: http://codecov.io/github/singingwolfboy/flask-sse/coverage.svg?branch=master
   :target: http://codecov.io/github/singingwolfboy/flask-sse?branch=master
   :alt: Test coverage
.. |docs| image:: https://readthedocs.org/projects/flask-sse/badge/?version=latest&style=flat
   :target: http://flask-sse.readthedocs.org/
   :alt: Documentation

{'fraction_non_alphanumeric': 0.16421895861148197, 'fraction_numerical': 0.0006675567423230974, 'mean_word_length': 3.810593900481541, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4752890', 'n_tokens_mistral': 1001, 'n_tokens_neox': 963, 'n_words': 227}