Skip to main content

A simple data-flow framework based on iterator chaining

Project description

https://github.com/maet3608/nuts-flow/blob/master/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 .

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.9.tar.gz (26.7 kB view details)

Uploaded Source

Built Distribution

nutsflow-1.0.9-py2-none-any.whl (36.0 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for nutsflow-1.0.9.tar.gz
Algorithm Hash digest
SHA256 cd13ff395be25af26bf34166790330781df357d65045233483dc7c7389b88dfb
MD5 ebe491d3a29a182e5582cdeb778b53e1
BLAKE2b-256 d1f6cc0da418b8a86b2621954c81decfa6d19c1d2420cab99c2273fb46476ce7

See more details on using hashes here.

File details

Details for the file nutsflow-1.0.9-py2-none-any.whl.

File metadata

File hashes

Hashes for nutsflow-1.0.9-py2-none-any.whl
Algorithm Hash digest
SHA256 ad3da467f0b9b35c8cb1f3b73f95640d35512c055b678dbb2e58128dc6456b94
MD5 9b5b5e39f5012182641e1ba7ab6dc38b
BLAKE2b-256 d39def7b336d3aab8837413f6b0cf97f20efbbf3f90d5a323ded92347c2ae0f1

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