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 https://img.shields.io/github/downloads/maet3608/nuts-flow/total.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.0.18.tar.gz (40.6 kB view details)

Uploaded Source

Built Distribution

nutsflow-1.0.18-py2.py3-none-any.whl (40.4 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: nutsflow-1.0.18.tar.gz
  • Upload date:
  • Size: 40.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for nutsflow-1.0.18.tar.gz
Algorithm Hash digest
SHA256 1d4e6d68ba15dd9fd380bb363de6eee91ee17b0567bfa23210cffdd189f4c13c
MD5 2a1e576c6aed1c57352b735aecfc11d7
BLAKE2b-256 47fadfb23a93fb2e6597752e0ef83aa0fb5188b0f91e37ca941f4b12cfebe72b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nutsflow-1.0.18-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f3e5268e9f0a727206cca80bba6a5532ad3f4e04844f528e900120757632e285
MD5 de0a0d33f236150d0776730954682888
BLAKE2b-256 976599e4027e339cf465edc4b728fd942cb55d7597e8aca194964685078be3d8

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