建立图表以处理流
emit的Python项目详细描述
emit是一个用于实时数据处理的python库。它可以分配工作 用Celery或RQ, coordinate execution in other languages,让你挥杆 以泰山式的精度从你的图形树中提取。
尝一尝:
fromemitimportrouterrouter=Router()@router.node(['word'],entry_point=True)defparse_document(msg):forwordinmsg.document.strip().split(' '):yieldword@router.node(['word','count'],'parse_document')defcount_word(msg):returnmsg.word,redis.zincrby('word_counts',msg.word,1)importrandomdocument='the words in this document will be counted and emitted by count_word'.split(' ')router(document=' '.join(random.choice(document)foriinrange(20)))
那你是怎么得到的?在皮皮上!
pip install emit
一些链接:
支持的Python:
- cpython 2.6
- cpython 2.7
- cpython 3.2
- cpython 3.3(目前芹菜除外)
- Pypy 1.9
从源/开发分支安装:
emit的发布相当频繁,因此您应该很好地使用 版本。但是,如果需要当前不在版本中的内容,请尝试 develop分支:
pip install git+git://github.com/BrianHicks/emit.git@develop
只是要被警告事情会破裂。一定要检查Travis看看你想要的平台是不是 正在通过。应该是,但也许不是。