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
Changelog: changelog
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 iter_model-3.0.0.tar.gz
.
File metadata
- Download URL: iter_model-3.0.0.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/6.5.0-1022-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b56fe833aa76378436eeb7c711c86c8d1f7ea6e24cad380e95f35bb46699df2 |
|
MD5 | b41dede5568a457a0b71ffb5553ec484 |
|
BLAKE2b-256 | bc3ba25246a796bff54c2f50d7c110c08c26ee4d3bfd6cef1000dc57652e7694 |
File details
Details for the file iter_model-3.0.0-py3-none-any.whl
.
File metadata
- Download URL: iter_model-3.0.0-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/6.5.0-1022-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0daff5eb452ab5846eb4d0e30d6a4b7e5a6323143e5105244488b7b00cca65a |
|
MD5 | 176182665a435974cd233e15b87e47ae |
|
BLAKE2b-256 | 93e8cb90dfc5c72d70f5b832a0c172cd10550469cfccaf802735603420e1c5ad |