<commit_before>LiveReload
==========

This is a brand new LiveReload in version 2.0.0.

.. image:: https://pypip.in/d/livereload/badge.png
   :target: https://pypi.python.org/pypi/livereload
   :alt: Downloads
.. image:: https://pypip.in/v/livereload/badge.png
   :target: https://pypi.python.org/pypi/livereload
   :alt: Version


Installation
------------

Python LiveReload is designed for web developers who know Python.

Install Python LiveReload with pip::

    $ pip install livereload

If you don't have pip installed, try easy_install::

    $ easy_install livereload


Developer Guide
---------------

The new livereload server is designed for developers. It can power a
wsgi application now::

    from livereload import Server, shell

    server = Server(wsgi_app)

    # run a shell command
    server.watch('static/*.stylus', 'make static')

    # run a function
    def alert():
        print('foo')
    server.watch('foo.txt', alert)

    # output stdout into a file
    server.watch('style.less', shell('lessc style.less', output='style.css'))

    server.serve()
<commit_msg>Documented `livereload` CLI utility<commit_after>LiveReload
==========

This is a brand new LiveReload in version 2.0.0.

.. image:: https://pypip.in/d/livereload/badge.png
   :target: https://pypi.python.org/pypi/livereload
   :alt: Downloads
.. image:: https://pypip.in/v/livereload/badge.png
   :target: https://pypi.python.org/pypi/livereload
   :alt: Version


Installation
------------

Python LiveReload is designed for web developers who know Python.

Install Python LiveReload with pip::

    $ pip install livereload

If you don't have pip installed, try easy_install::

    $ easy_install livereload

Command Line Interface
----------------------

Python LiveReload provides a command line utility, ``livereload``, for starting a server in a directory.

By default, it will listen to port 35729, the common port for `LiveReload browser extensions`_. ::

    $ livereload --help
    usage: livereload [-h] [-p PORT] [directory]

    Start a `livereload` server

    positional arguments:
      directory             Directory to watch for changes

    optional arguments:
      -h, --help            show this help message and exit
      -p PORT, --port PORT  Port to run `livereload` server on

.. _`livereload browser extensions`: http://feedback.livereload.com/knowledgebase/articles/86242-how-do-i-install-and-use-the-browser-extensions-

Developer Guide
---------------

The new livereload server is designed for developers. It can power a
wsgi application now::

    from livereload import Server, shell

    server = Server(wsgi_app)

    # run a shell command
    server.watch('static/*.stylus', 'make static')

    # run a function
    def alert():
        print('foo')
    server.watch('foo.txt', alert)

    # output stdout into a file
    server.watch('style.less', shell('lessc style.less', output='style.css'))

    server.serve()

{'fraction_non_alphanumeric': 0.13331071913161466, 'fraction_numerical': 0.005427408412483039, 'mean_word_length': 2.9583892617449665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5763705', 'n_tokens_mistral': 936, 'n_tokens_neox': 849, 'n_words': 280}