<commit_before># Emit

[![Build Status](https://travis-ci.org/BrianHicks/emit.png?branch=master)](https://travis-ci.org/BrianHicks/emit)

Emit gives you subscriptions to function results. Data pipelines and other fun
things abound. Observe:

```python
# router.py
from emit.router import Router

router = Router()

# tasks.py (or other like file)
from .router import router

@router.node(['n'])
def yield_n(n):
    for i in range(n):
        yield i

@router.node(['square'], ['yield_n'])
def square(msg):
    result = msg.n ** 2
    redis.sadd('squares', result)
    return result

# from the repl
>>> yield_n(5)
...
>>> redis.smembers('squares')
set([0, 1, 4, 9, 16])
```

## This is not really ready for production

It's all in one Python process right now. Next steps are adding support for
queue services like Celery and RQ. Watch this repo!<commit_msg>make README *much* more awesome<commit_after># Emit

Emit is a Python library for realtime data processing. It can [distribute work
with Celery][celery-docs], [coordinate execution in other
languages][multilang-docs], and let you swing from the trees of your graph with
Tarzan-like precision.

A taste:

```python
from emit import router

router = Router()

@router.task(['word'])
def parse_document(msg):
    for word in msg.document.strip().split(' '):
        yield word

@router.task(['word', 'count'], 'parse_document')
def count_word(msg):
    return msg.word, redis.zincrby('word_counts', msg.word, 1)
```

Some Links:

 - [Project Documentation][docs]
 - [Travis][travis] ([![Build Status](https://travis-ci.org/BrianHicks/emit.png?branch=master)][travis])
 - [Github][github]
 - [Apache License][license]

[celery-docs]: https://emit.readthedocs.org/en/latest/celery.html "Celery Documentation"
[multilang-docs]: https://emit.readthedocs.org/en/latest/multilang.html "Multilang Documentation"
[docs]: http://emit.readthedocs.org/en/latest/ "Emit Documentation"
[travis]: https://travis-ci.org/BrianHicks/emit "Emit on Travis CI"
[github]: https://github.com/BrianHicks/emit "Emit on Github"
[license]: https://github.com/BrianHicks/emit/blob/master/LICENSE.md "Apache License"
{'fraction_non_alphanumeric': 0.1507232851143257, 'fraction_numerical': 0.004199720018665422, 'mean_word_length': 4.671957671957672, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, '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': '158292', 'n_tokens_mistral': 744, 'n_tokens_neox': 721, 'n_words': 199}