iter-model uses a method approach instead of individual functions to work with iterable objects.
Project description
iter_model - provides a convenient API for interacting with iterable objects (Iterable). iter_model uses a methods approach instead of individual functions.
iter_model also provides async analog of all methods. This is useful when interacting with asynchronous iterable objects (AsyncIterable), because python does not have ready functions for these cases.
Therefore, iter_model provides SyncIter class for Iterable, and AsyncIter for AsyncIterable.
Example
from iter_model import SyncIter
it = SyncIter(range(10)) # SyncIter for sync iterables
result = (
it.where(lambda x: x % 2 == 0) # filter only odd values
.take(3) # take first 3 value
.map(lambda x: x ** 2) # square all values
)
print(result.to_list())
Links
Source code: github.com/VolodymyrBor/iter_model
Documentation: iter_model
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
iter_model-1.3.0.tar.gz
(8.0 kB
view hashes)
Built Distribution
iter_model-1.3.0-py3-none-any.whl
(10.7 kB
view hashes)
Close
Hashes for iter_model-1.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 380871bf8f9cd1cce017d48c05086fcf1c15781b6d6fbde1b26126fff1e832b2 |
|
MD5 | 9291ceaa1872632e9d39e816fa4d68b7 |
|
BLAKE2b-256 | 80b803d5181ba0b22dbd36cf87c382801366364d7ecfb0aa30b8dd3dd8df1451 |