https://github.com/maet3608/nuts-flow
A simple dataflow framework in Python
https://github.com/maet3608/nuts-flow
flow-based-programming flowframework functional-programming iterators itertools python
Last synced: 23 days ago
JSON representation
A simple dataflow framework in Python
- Host: GitHub
- URL: https://github.com/maet3608/nuts-flow
- Owner: maet3608
- License: other
- Created: 2017-02-01T23:00:28.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2021-03-04T05:37:31.000Z (about 5 years ago)
- Last Synced: 2025-08-22T10:29:53.725Z (7 months ago)
- Topics: flow-based-programming, flowframework, functional-programming, iterators, itertools, python
- Language: Python
- Size: 8.7 MB
- Stars: 18
- Watchers: 2
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
.. image:: pics/nutsflow_logo.gif
:align: center
- `Introduction `_
- `Installation `_
- `Tutorial `_
- `Documentation `_
- `Github `_
**nuts-flow** is largely a thin wrapper around Python's *itertools* that allows
the chaining of iterators using the ``>>`` operator. This leads to more
readable code that highlights the flow of data. The following example shows
two implementations of a simple data processing pipeline; the first based on
*itertools* and the second using **nuts-flow**:
>>> from itertools import islice
>>> list(islice(filter(lambda x: x > 5, xrange(10)), 3))
[6, 7, 8]
>>> from nutsflow import Range, Filter, Take, Collect, _
>>> Range(10) >> Filter(_ > 5) >> Take(3) >> Collect()
[6, 7, 8]
Both examples extract the first three numbers within range [0, 9]
that are greater than five. However, the **nuts-flow** pipeline
is easier to understand than the nested *itertools* code.
**nuts-flow** is the base for `nuts-ml `_,
which is described `here `_ .
.. image:: https://badge.fury.io/py/nutsflow.svg
:target: https://badge.fury.io/py/nutsflow
.. image:: https://img.shields.io/pypi/pyversions/nutsflow.svg
:target: https://pypi.python.org/pypi/nutsflow/
.. image:: https://travis-ci.org/maet3608/nuts-flow.svg?branch=master
:target: https://travis-ci.org/maet3608/nuts-flow
.. image:: https://coveralls.io/repos/github/maet3608/nuts-flow/badge.svg?branch=master
:target: https://coveralls.io/github/maet3608/nuts-flow?branch=master
.. image:: https://img.shields.io/github/issues/maet3608/nuts-flow.svg
:target: https://github.com/maet3608/nuts-flow/issues
.. image:: https://img.shields.io/badge/license-Apache%202-blue.svg
:target: https://github.com/maet3608/nuts-ml/blob/master/LICENSE