Skip to main content

A simple data-flow framework based on iterator chaining

Project description

pics/nutsflow_logo.gif

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, ifilter
>>> list(islice(ifilter(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 .

https://badge.fury.io/py/nutsflow.svg https://img.shields.io/pypi/pyversions/nutsflow.svg https://travis-ci.org/maet3608/nuts-flow.svg?branch=master https://coveralls.io/repos/github/maet3608/nuts-flow/badge.svg?branch=master https://img.shields.io/github/issues/maet3608/nuts-flow.svg https://img.shields.io/badge/license-Apache%202-blue.svg

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nutsflow-1.1.0.tar.gz (48.3 kB view details)

Uploaded Source

Built Distribution

nutsflow-1.1.0-py2.py3-none-any.whl (47.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file nutsflow-1.1.0.tar.gz.

File metadata

  • Download URL: nutsflow-1.1.0.tar.gz
  • Upload date:
  • Size: 48.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for nutsflow-1.1.0.tar.gz
Algorithm Hash digest
SHA256 824b7a2df669609cc8d4726a192f628e15e0a323572ffbf0e7889345056ddb4f
MD5 504a1b0c20168c7b287ef66824a5a112
BLAKE2b-256 0c1e131ed1c433b4c4e2d0ef57dfd1ff4d145fe4e15d4b2511b47b54245d8d01

See more details on using hashes here.

File details

Details for the file nutsflow-1.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: nutsflow-1.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 47.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for nutsflow-1.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6e5647b6b536139eb350aae64bd26ffc8099649063b72378ee23add20a111946
MD5 a82152ffa070c2b527dcc1652e4859ba
BLAKE2b-256 c135e6fac2797db06bdc404c69e31b1d547d6a899c9daed3265c865870513ca4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page