A simple data-flow framework based on iterator chaining
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file nutsflow-1.0.16.tar.gz
.
File metadata
- Download URL: nutsflow-1.0.16.tar.gz
- Upload date:
- Size: 38.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f182abbc5a10e936bb2ecca69db7988cd8a0c3db9957ea4044f5210eeecd82c |
|
MD5 | 576f89a8387adf94d1aef73d7b34680b |
|
BLAKE2b-256 | 70522f53d4adb35f37ca9f11d07c85cbdf92070839f3a8fb31275722279b196f |
File details
Details for the file nutsflow-1.0.16-py2-none-any.whl
.
File metadata
- Download URL: nutsflow-1.0.16-py2-none-any.whl
- Upload date:
- Size: 38.4 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a0cd70ca3ebefb93c39a49e86268a7878d1e676217531833c57367ad92c58bd |
|
MD5 | 71a54cac8d32e2a0deee586da88d8bd3 |
|
BLAKE2b-256 | c54c6a0fb9c48c1cb54c49b2456d43d9b85f966bd41d9eff3584a56428601c4d |