Skip to main content

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)
    .collect(list)
)
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.2.tar.gz (6.0 kB view hashes)

Uploaded Source

Built Distribution

ziper-0.1.2-py3-none-any.whl (6.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page