A functional interface for python iterator
Project description
functionalstream
Installation
pip install functionalstream
Example
from functionalstream import Stream
# lst1 = [0, 6, 12, 18, 24]
lst1 = Stream(range(10)).filter(lambda x: x % 2 == 0).map(lambda x: x * 3).to_list()
# lst2 = [(1, 2), (3, 4)]
lst2 = Stream([(1,2), (3,4), (6,5)]).filter(lambda x, y: x < y, star=True).to_list()
# array = array([0., 1., 2., 3., 4., 5., 6., 7., 8., 9.])
array = Stream(range(10)).to_numpy_array(dtype=float)
# for function which has side effect
Stream(range(10)).apply(lambda x: print(x))
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
functionalstream-0.1.7.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for functionalstream-0.1.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a9f4f9b6569396ae1aab75f27c194436c9eac58cbe1b4d48de7b76ee35be25e |
|
MD5 | 7e069ca06b2a3a2c1c556c9ccc891c79 |
|
BLAKE2b-256 | 214ab40614efb6decb1f4e87e3b0c63eeb88f0aaa38ede17565134acfb6a7c79 |