Rust-like iterator for Python
Project description
ziper
Rust-like iterator for Python
Install
From PyPI:
pip install ziper
From git:
pip install git+https://github.com/cospectrum/ziper.git
Usage
from ziper import Iter
xs = ['1', '2', 'a', '3', '4', 'b', 'c']
ys = [6, 7, 8, 9]
result = list(
Iter(xs)
.filter(lambda x: x.isdecimal())
.map(int)
.chain(ys)
.filter(lambda x: x % 2 == 0)
)
assert result == [2, 4, 6, 8]
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
ziper-0.1.0.tar.gz
(5.8 kB
view hashes)
Built Distribution
ziper-0.1.0-py3-none-any.whl
(6.3 kB
view hashes)